# Differentiability of trigonometric piecewise functions

So I have a function of a real variable $x$: $f(x) = \left\{\begin{array}{lr} x \int_0^{tanx} \dfrac{t^2}{\sqrt{1+t^3}}dt & if \: x \ge 0\\ sin^2(x) & if \: x \lt 0 \end{array}\right.$

I am trying to show this is continuous and differentiable over $\mathbb{R}$. Here is what I have:

Differentiability implies continuity. So I took the first part; now we can consider this as two distinct parts: $x$ and $\int_0^{tanx} \dfrac{t^2}{\sqrt{1+t^3}}dt$. $x$ is clearly differentiable. Now, $\int_0^{tanx} \dfrac{t^2}{\sqrt{1+t^3}}dt = \dfrac{1}{3}\int_1^{tan^3(x)+1}\dfrac{1}{\sqrt{u}}du = \dfrac{2\sqrt{u}}{3}\big|_1^{tan^3(x)+1}$ for $u=t^3+1, \: du=3t^2dt$. We can evaluate this to $\dfrac{2}{3}(\sqrt{tan^3(x)+1}-1)$ which gives us the condition that $tan^3(x) \ge 0$ and thus $tan^3(x) \ge -1$.

And of course $sin^2(x)$ is differentiable and thus continuous since $sin(x)$ is differentiable and $sin^2(x) > 0, \: \forall x \lt 0$.

Is this right way to proceed? I am not sure how to move forward. Do I need to use limits?

-
I don't get it: what is $\;f\left(\frac\pi2\right)\;$ , for example? – DonAntonio Feb 25 '14 at 3:38

I think that when you have these exercises you don't have to solve the integral, I think you should use some thoerems. Here is what I would do. The function is continuos because the only point that one has to study is $0$ and one has that the $lim_{x\to 0^+} x\int_0 ^{tan(x)} \frac{t^2}{\sqrt{1+t^3}}=0$ because as $x\to 0^+$ $tan(x)\to 0$. Moreover, $sin^2(x)\to 0$ as $x \to 0^-$. As regards differentiability, one has to check only the point $0$ as both functions are differentiable in $(0,+\infty)$ and $(-\infty,0)$, respectively. One has $$lim_{x\to 0^-}[sin^2(x)]'=lim_{x\to 0^-}[2sin(x)cos(x)]=0,$$ and $$lim_{x\to 0^+} \left[x\int_0 ^{tan(x)} \frac{t^2}{\sqrt{1+t^3}}\right]'= lim_{x\to 0^+} \int_0 ^{tan(x)} \frac{t^2}{\sqrt{1+t^3}}+\left[\int_0 ^{tan(x)} \frac{t^2}{\sqrt{1+t^3}}\right]'=\\ =lim_{x\to 0^+} \int_0 ^{tan(x)} \frac{t^2}{\sqrt{1+t^3}}+\left[ \frac{tan(x)^2}{\sqrt{1+tan(x)^3}}\right](tan(x))'=\\ =lim_{x\to 0^+} \int_0 ^{tan(x)} \frac{t^2}{\sqrt{1+t^3}}+\left[ \frac{tan(x)^2}{\sqrt{1+tan(x)^3}}\right](tan(x)^2+1)=0$$ In the second limit I used the Fundamental theorem of calculus. So both limits are equal and the function is differentiable.