You are a helpful assistant that can solve the given question step by step with the help of the wikipedia search tool and python interpreter tool. Given a question, you need to first think about the reasoning process in the mind and then provide the answer. During thinking, you can invoke the wikipedia search tool to search and python interpreter tool to calculate the math problem for fact information about specific topics if needed. The reasoning process and answer are enclosed within <think> </think> and <answer> </answer> tags respectively, and the search query and result are enclosed within <search> </search> and <result> </result> tags respectively. For example, <think> This is the reasoning process. </think> <search> search query here </search> <result> search result here </result> <think> This is the reasoning process. </think> <python> python code here </python> <result> python interpreter result here </result> <think> This is the reasoning process. </think> <answer> The final answer is \[ oxed{answer here} \] </answer>. In the last part of the answer, the final exact answer is enclosed within oxed{} with latex format.
system
A certain university needs $40L$ of helium gas to make balloon decorations for its centennial celebration. The chemistry club voluntarily took on this task. The club's equipment can produce a maximum of $8L$ of helium gas per day. According to the plan, the club must complete the production within 30 days. Upon receiving the task, the club members immediately started producing helium gas at a rate of $xL$ per day. It is known that the cost of raw materials for producing $1L$ of helium gas is $100$ yuan. If the daily production of helium gas is less than $4L$, the additional cost per day is $W_1=4x^2+16$ yuan. If the daily production of helium gas is greater than or equal to $4L$, the additional cost per day is $W_2=17x+\frac{9}{x}-3$ yuan. The production cost consists of raw material cost and additional cost.

$(1)$ Write the relationship between the total cost $W$ (in yuan) and the daily production $x$ (in $L$).

$(2)$ When the club produces how many liters of helium gas per day, the total cost is minimized? What is the minimum cost?
user
4640
rule
A certain university needs $40L$ of helium gas to make balloon decorations for its centennial celebration. The chemistry club voluntarily took on this task. The club's equipment can produce a maximum of $8L$ of helium gas per day. According to the plan, the club must complete the production within 30 days. Upon receiving the task, the club members immediately started producing helium gas at a rate of $xL$ per day. It is known that the cost of raw materials for producing $1L$ of helium gas is $100$ yuan. If the daily production of helium gas is less than $4L$, the additional cost per day is $W_1=4x^2+16$ yuan. If the daily production of helium gas is greater than or equal to $4L$, the additional cost per day is $W_2=17x+\frac{9}{x}-3$ yuan. The production cost consists of raw material cost and additional cost.

$(1)$ Write the relationship between the total cost $W$ (in yuan) and the daily production $x$ (in $L$).

$(2)$ When the club produces how many liters of helium gas per day, the total cost is minimized? What is the minimum cost?
train