Explore calculusLesson 26 of 48 · 8 min

Differentiate a composed expression

Calculate a derivative and interpret the chain-rule factor.

Maths refresher: Slope and the chain rule

A derivative measures local change. For a composition, multiply the outer derivative by the derivative of its input.

ddxex2=ex2⋅2x\frac{d}{dx}e^{x^2}=e^{x^2}\cdot2x
Worked example

At x=1x=1, the function value is ee but its derivative is 2e2e. These are different quantities.

Maths prerequisite map ↗

A derivative describes the local rate of change of a function with respect to a chosen variable. SymPy diff applies symbolic differentiation rules to an expression. State the variable explicitly, particularly when parameters appear in the formula.

See the mathematics
-0.500.511.5-21.254.57.7511xy
-0.500.511.5-21.254.57.7511xy
f(x)=ex2,f′(1)=2ef(x)=e^{x^2},\quad f\prime(1)=2e
  • ex2e^{x^{2}}
  • 2e(x−1)+e2 e \left(x - 1\right) + e
Starter reference. Green: the function. Amber: its tangent at x = 1. A derivative describes local slope.

For a composed function, the chain rule includes the derivative of the inner expression. Differentiating exp(x squared) therefore produces both an exponential factor and a 2x2x factor. Omitting the inner derivative changes the rate.

The example also evaluates the derivative at a specific input. That number describes the slope there, not the function’s value. Units follow the ratio of output units to input units, and a symbolic derivative does not establish whether the original formula accurately models a measured process.

Will differentiating ex2e^{x^2} give only ex2e^{x^2}?

Write a prediction (optional)

Exact symbolic investigation

Select Run Python with the code unchanged.

Tools
About Python

Python and the course packages can load while you read. Each run starts with fresh user variables; imported modules stay loaded. Stop replaces the worker. Runtime details ↗

Ctrl+Enter or ⌘+Enter runs Python.

Compare with the worked example

Executed from the published Python during the site build. Your own run appears above. Build environment ↗

Function
ex2e^{x^{2}}
Derivative
2xex22 x e^{x^{2}}
Value at 1
ee
Slope at 1
2e2 e
Second derivative
2(2x2+1)ex22 \left(2 x^{2} + 1\right) e^{x^{2}}
Worked text output
Function: exp(x**2)
Derivative: 2*x*exp(x**2)
Value at 1: E
Slope at 1: 2*E
Second derivative: 2*(2*x**2 + 1)*exp(x**2)

Read the starter result

Read Derivative for the factor 2x2x from the inner derivative. Compare Value at 1 with Slope at 1: they evaluate different expressions at the same input.

Edit and compare

Replace sp.exp(x**2) with sp.exp(3*x+1) on the expression line. Select Run Python and read Derivative. Which factor comes from differentiating the new inner expression?

Return to the editor

Scope. Differentiation is conditional on the formula and variable assumptions; it does not validate a physical or statistical model.

Try a fresh case

For sin⁡(5x)\sin(5x), which factor comes from differentiating the inner expression?

Choose an answer
Need a hint?
Hint 1

Separate the outer rule from the inner expression.

Hint 2

Differentiate 5x5x first.

Your notesNotes save in this browser when storage is available.