# Chain rule to differentiate $\sin ^2\frac{x}{2}$

I have this equation $$\sin ^2(\frac{x}{2})$$

Using the chain rule $M'(N(x)).N'(x)$:

\begin{align*} &M= (\sin \frac{x}{2})^2 \\ &N= \frac{x}{2}\end{align*}

That makes

$$2\sin \frac{x}{2}*\frac{1}{2}$$ or $$\sin \frac{x}{2}$$

Going again, we should have

$$\frac{1}{2} \cos \frac{x}{2}$$ or $$\frac{\cos \frac{x}{2}}{2}$$

Yet solution is giving me

$$(\sin \frac{x}{2})(\cos \frac{x}{2})$$

Why...?

• I'm guessing you want to compute the derivative of that function, right? – DonAntonio May 27 '16 at 21:31
• You didn't put $\sin$ in the formula for $N$ – alphacapture May 27 '16 at 21:32
• Hi @Joanpemo yes – Andy K May 27 '16 at 21:33
• This reminds me of your previous question math.stackexchange.com/q/1800510/72031 and the answer is again same. Try to figure out how we can get from $x$ to $f(x) = \sin^{2}(x/2)$. This happens via $x \to x/2 = A \to \sin (A) = B \to B^{2} = f(x)$ and hence reversing the order and taking derivatives we get $f'(x) = (2B)(\cos A)(1/2) = B\cos A = \sin A\cos A = \sin(x/2)\cos(x/2)$. – Paramanand Singh May 29 '16 at 9:55
• Looking at this question and the one linked in my previous comment, it appears that you have some trouble identifying $f(x)$ as a composite of other functions. This can be a problem in beginning but once you start thinking about going from $x$ to $f(x)$ in step by step manner using simpler functions you won't have any issue. – Paramanand Singh May 29 '16 at 10:00

Write down

$$\begin{cases}h(x)=x^2\\g(x)=\sin x\\k(x)=\frac x2\end{cases}\;\;\implies \sin^2\frac x2=h\circ g\circ k(x)=h(g(k(x)))\implies$$

$$\left(\sin^2\frac x2\right)'=h'(g(k(x))\cdot g'(k(x))\cdot k'(x)=2\sin\frac x2\cdot\cos\frac x2\cdot\frac12=\frac12\sin x$$

using the trigonometric identity

$$\sin2\alpha=2\sin\alpha\cos\alpha$$

• very interesting. I need to double check the stuff – Andy K May 27 '16 at 21:41
• It is just hte application of the chain rule three times. You can easily get it with a little and easy inductive argument, and observing that $$h\circ g\circ k=(h\circ g)\circ k$$ – DonAntonio May 27 '16 at 21:44
• Hi @Joanpemo, many thanks for your answer. It is clear and easy. Yet, when do you know you should $h\circ g\circ k(x)$ and when you should do something else ...? What are the rules, if there are any? – Andy K May 28 '16 at 14:40
• points are yours , Sir. – Andy K May 28 '16 at 14:46
• @AndyK As in many other cases, practice and experience. Yet, as the chain rule works wonderfully, you do not need to apply it in in any specific order . You only need to recognize the different functions and differentiate them carefully and then take the whole product. – DonAntonio May 28 '16 at 15:47

$2\sin(x/2)\cdot\cos(x/2)\cdot\frac{1}{2}=\sin(x/2)\cdot\cos(x/2)$

The problem is that you took the derivative of $x/2$ twice. For the chain rule and future complicated problems, think of going from the outside to the inside so as to prevent taking the derivatives of the same expression twice.

Also, once you took the derivative of $\sin^2$ you have to keep the $\sin$ and not take the derivative again.

• Hi @Ken, thanks for your answer. – Andy K May 28 '16 at 14:45

Let $u=sin(\frac{x}2)$
Apply the chain rule we get $\frac{d}{dx}sin^2(\frac{x}2)=\frac{d}{du}(u^2)\frac{d}{dx}(sin(\frac{x}2))$
$\frac{d}{du}(u^2)=2u$
$\frac{d}{dx}(sin(\frac{x}2))=\frac12cos(\frac{x}2)$

So $$\frac{d}{du}(u^2)\frac{d}{dx}(sin(\frac{x}2))=2u(\frac12)cos(\frac{x}2)=ucos(\frac{x}2)=sin(\frac{x}2)cos(\frac{x}2)$$

• HI @Joanna, thanks for your answer. – Andy K May 28 '16 at 14:45

Note: $\frac{d}{dx}$ and $'$ denote the derivative.

$$y=\sin^2\left(\frac{x}{2}\right)=\left(\sin\frac{x}{2}\right)^2$$

I will refer to $2$ as my power, $\sin$ as my expression, and $x/2$ as my angle. Basically, we are using chain rule twice.

Chain rule says we'll get power times expression to power minus one times derivative of expression times derivative of expression. Generally this:

$$2(\exp)^1(\exp')$$

$$y'=2\left(\sin\frac{x}{2}\right)^1\cdot\left(\frac{d}{dx}\sin\left(\frac{x}{2}\right)\right)$$

Now, for taking the derivative of $\sin\frac{x}{2}$, we use chain rule again. Generally, it's derivative of angle times derivative of expression of angle, or this:

$$\text{ang}'\cdot \exp'(\text{ang})$$

For you

$$\frac{d}{dx}\sin\frac{x}{2}=\frac{1}{2}\cos\frac{x}{2}$$

Putting it all together:

$$y'=2\left(\sin\frac{x}{2}\right)^1\left(\frac{1}{2}\cos\frac{x}{2}\right)$$

Cancelling $2$ and $1/2$:

$$y'=\sin\frac{x}{2}\cdot\cos\frac{x}{2}$$

Using double ange formula for sine:

$$y'=\frac{1}{2}\sin x$$

• Hi @lanier-freeman, I would say it is very impressive. I would say one thing though: A good explanation is always handy. All the best for next year in Georgia Tech. – Andy K May 28 '16 at 14:43
• You're correct, would you still like an explanation of my steps? – Lanier Freeman May 28 '16 at 14:48
• It would be great, so yes – Andy K May 28 '16 at 14:52
• Steps added. If you need any additional explanation, let me know. – Lanier Freeman May 28 '16 at 15:07