The Chain Rule: Differentiating sin²(x)

April 12, 2026

Problem

Visualize the chain rule applied to f(g(x)) where f(u) = u² and g(x) = sin(x).

Explanation

The chain rule is the engine that lets you differentiate composite functions. The slogan is:

Take the derivative of the outer function evaluated at the inner function, then multiply by the derivative of the inner.

In symbols, if h(x)=f(g(x))h(x) = f(g(x)), then:

h(x)=f(g(x))g(x)h'(x) = f'(g(x)) \cdot g'(x)

This visualization shows the composition sin2(x)\sin^{2}(x) — simple enough to compute by hand, rich enough to feel the chain rule in action.

Setting Up

Define:

  • Inner: g(x)=sinxg(x) = \sin x, so g(x)=cosxg'(x) = \cos x
  • Outer: f(u)=u2f(u) = u^{2}, so f(u)=2uf'(u) = 2u

The composite is h(x)=f(g(x))=(sinx)2=sin2(x)h(x) = f(g(x)) = (\sin x)^{2} = \sin^{2}(x).

Step-by-Step Solution

Given: h(x)=sin2(x)h(x) = \sin^{2}(x). Find: h(x)h'(x) using the chain rule, and verify by simplifying.


Step 1 — Identify the inner and outer functions.

g(x)=sinxf(u)=u2g(x) = \sin x \qquad f(u) = u^{2}

So h(x)=f(g(x))h(x) = f(g(x)).

Step 2 — Differentiate each separately.

g(x)=cosxg'(x) = \cos x

f(u)=2uf'(u) = 2u

Step 3 — Apply the chain rule formula.

h(x)=f(g(x))g(x)h'(x) = f'(g(x)) \cdot g'(x)

Plug in: f(g(x))=2g(x)=2sinxf'(g(x)) = 2 \cdot g(x) = 2\sin x, and g(x)=cosxg'(x) = \cos x:

h(x)=2sinxcosxh'(x) = 2\sin x \cdot \cos x

Step 4 — Simplify using a double-angle identity.

Recall the identity 2sinxcosx=sin(2x)2\sin x \cos x = \sin(2x). So:

h(x)=sin(2x)h'(x) = \sin(2x)

Step 5 — Verify at a specific point. Try x=π/4x = \pi/4.

Direct: h(π/4)=sin2(π/4)=(2/2)2=1/2h(\pi/4) = \sin^{2}(\pi/4) = (\sqrt{2}/2)^{2} = 1/2.

Slope from chain rule: h(π/4)=2sin(π/4)cos(π/4)=22222=212=1h'(\pi/4) = 2\sin(\pi/4)\cos(\pi/4) = 2 \cdot \dfrac{\sqrt{2}}{2}\cdot\dfrac{\sqrt{2}}{2} = 2 \cdot \dfrac{1}{2} = 1.

Or simplified: h(π/4)=sin(2π/4)=sin(π/2)=1h'(\pi/4) = \sin(2 \cdot \pi/4) = \sin(\pi/2) = 1 ✓.

Both forms agree. The slope of sin2(x)\sin^{2}(x) at x=π/4x = \pi/4 is exactly 1.

Step 6 — Interpret the answer.

h(x)=sin(2x)h'(x) = \sin(2x) has period π\pi (half the period of sinx\sin x), which makes sense: sin2(x)\sin^{2}(x) has two peaks per 2π2\pi cycle (one at π/2\pi/2 and one at 3π/23\pi/2, both equal to 1), so its derivative should oscillate twice as fast.


Answer:

  ddx[sin2(x)]=2sinxcosx=sin(2x)  \boxed{\;\dfrac{d}{dx}\bigl[\sin^{2}(x)\bigr] = 2\sin x \cos x = \sin(2x)\;}

The chain rule gives us 2sinxcosx2\sin x\cos x directly, and a double-angle identity simplifies it to sin(2x)\sin(2x).

Try It

  • Slide the point along the curve — watch how the slope of sin2(x)\sin^{2}(x) matches sin(2x)\sin(2x) at every point.
  • Toggle show inner to see sin(x)\sin(x) separately. Notice that h(x)=sin2(x)h(x) = \sin^{2}(x) stays non-negative (it's a square) and doubles the frequency of zero-crossings.
  • The HUD shows both forms of the answer: the raw chain-rule output 2sinxcosx2\sin x\cos x and the simplified sin(2x)\sin(2x).

Interactive Visualization

Parameters

0.79
Your turn

Got your own math or physics problem?

Turn any problem into an interactive visualization like this one — powered by AI, generated in seconds. Free to try, no credit card required.

Sign Up Free to Try It30 free visualizations every day
The Chain Rule: Differentiating sin²(x) | MathSpin