If $f(x)= \int_0^x x^2\sin(t^2)dt$ then $f'(x)= ?$

Since the integral doesn't depend on $x$, I take $x^2$ out of the integral and take the derivative of a constant times a function. The final result is $x^2\sin(x^2)$.

I saw one suggested answer which gives a different answer: $x^2\sin(x^2)+2xf(x)$, which is the derivative using the product rule. Which one is correct? Please explain, thanks.

$x^2$ is a constant with respect to the integral (since it's an integral with respect to $t$) but $x^2$ isn't a constant when you differentiate with respect to $x$ (i.e. when you want to compute $f'(x)$).

Thus

$$f'(x) = \dfrac{d}{dx}\left(x^2\int_0^x\sin(t^2)dt\right) = \dfrac{d}{dx}\left(x^2\right)\underbrace{\int_0^x\sin(t^2)dt}_{=f(x)/x^2} + x^2\dfrac{d}{dx}\left(\int_0^x\sin(t^2)dt\right)$$

which gives $$f'(x) = 2x\dfrac{f(x)}{x^2} + x^2\sin(x^2) = 2\dfrac{f(x)}{x} + x^2\sin(x^2).$$

• Right. Thank you. – paf May 13 '18 at 17:58
• You're welcome. And yet, somehow, your incorrect solution received up votes. LOL – Mark Viola May 13 '18 at 17:59
• Thank you Paf! This is the best answer. Now I understand the solution and the reasoning behind the question. Also thanks for the edit. – É. DD May 13 '18 at 18:08

Let $f(x)$ be given by the integral

$$f(x)=x^2\int_0^x \sin(t^2)\,dt$$

Then, from the product rule we have

\begin{align} f'(x)&=\left(\frac{dx^2}{dx}\right)\left(\int_0^x \sin(t^2)\,dt\right)+\left(x^2\right)\left(\frac{d}{dx}\int_0^x \sin(t^2)\,dt\right)\\\\ &=2x\int_0^x \sin^2(t)\,dt+x^2\sin(x^2)\\\\ &=\frac{2f(x)}{x}+x^2\sin(x^2) \end{align}

• Good morning! ${}{}$ – copper.hat May 13 '18 at 17:57
• Hi Joe! How are you? – Mark Viola May 13 '18 at 17:58
• Failing miserably at Mother's Day again :-) – copper.hat May 13 '18 at 17:59
• My wife just left to visit her older son who lives in Phoenix. – Mark Viola May 13 '18 at 18:02
• Hey thanks for your answer Mark! This was really helpful. – É. DD May 13 '18 at 18:04

$$\displaystyle f(x)= \int_0^x x^2\sin(t^2)dt$$ Apply Leibniz rule:

$$\displaystyle f'(x)=\displaystyle x^2\sin(x^2)+ \int_0^x \partial_x x^2\sin(t^2)dt$$ $$\displaystyle f'(x)=\displaystyle x^2\sin(x^2)+2x\int_0^x \sin(t^2)dt$$ $$\displaystyle f'(x)=\displaystyle x^2\sin(x^2)+2 \frac {f(x)}x$$

• Thank you for your answer Isham! – É. DD May 13 '18 at 18:10
• yw @É.DD ....... – Isham May 13 '18 at 18:12