Chalk−1

Math · Calculus I · Worked example

Differentiate x² cos x with the product rule

Differentiate f⁡(x)=x2cosx, then find the slope of its graph at x=π.

f⁡(x)=x2cosx

See why expanding fails

In x2(x+1) you could multiply out and use the power rule. Here there is nothing to multiply out, because x2 and cosx are different kinds of function. The product rule is the route.

Name the four pieces

The first factor is x2, with derivative 2⁢x. The second is cosx, with derivative −sinx. The minus sign belongs to g′, so write it down now.

f=x2,  f′=2⁢x,g=cosx,  g′=−sinx
f=x2,  f′=2⁢xg=cosx,  g′=−sinx

Apply the product rule

The first factor’s derivative times the second, plus the first times the second’s derivative. Keep the brackets around −sinx until the next step.

f′(x)=2⁢xcosx+x2(−sinx)

Simplify

Adding a negative is subtracting. Both terms share a factor of x, so the derivative can also be written x⁢(2cosx−xsinx).

f′(x)=2⁢xcosx−x2sinx

Find the slope at x=π

cosπ=−1 and sinπ=0. The first term is 2⁢π⋅(−1)=−2⁢π and the second is π2⋅0=0, which leaves f′(π)=−2⁢π≈−6.283. The graph is falling steeply at x=π.

f′(π)=2⁢π⁢(−1)−π2(0)=−2⁢π

Test it with numbers

From x=π to π+0.001 the secant slope is about −6.279, close to −6.283. The wrong sign, 2⁢xcosx+x2sinx, also gives −2⁢π here, because sinπ=0. At x=π⁢/2 the two differ, −π2/4 against +π2/4, and a secant there finds the falling one.

Result

f′(x) =2⁢xcosx−x2sinx, and f′(π)=−2⁢π≈−6.28.

f′(x)=2⁢xcosx−x2sinx

Your turn

1. One like the example

Differentiate y=xsinx.

Show the answer and explanation

d⁢y⁢/⁢d⁢x=sinx+xcosx.

The first factor x has derivative 1, and the second, sinx, has derivative cosx. The product rule gives 1⋅sinx+x⋅cosx.

y=xsinxd⁢yd⁢x=sinx+xcosx

2. A variation

Differentiate f⁡(x)=exsinx. Here neither factor is a polynomial.

Show the answer and explanation

f′(x) =ex(sinx+cosx).

ex is its own derivative and sinx has derivative cosx. The product rule gives exsinx+excosx, and factoring out ex gives ex(sinx+cosx).

f⁡(x)=exsinxf′(x)=exsinx+excosxf′(x)=ex(sinx+cosx)

3. Somewhere new

Where does the graph of g⁡(x)=x ex have a horizontal tangent?

Show the answer and explanation

At x=−1, where g′(−1)=0. The point is (−1,−1⁢/⁢e), about (−1,−0.368).

The product rule gives g′(x) =1⋅ex+x⋅ex =(1+x)ex. Because ex is never 0, g′(x)=0 only when 1+x=0, at x=−1. There g⁡(−1)=−e−1≈−0.368.

g⁡(x)=xexg′(x)=ex+xexg′(x)=(1+x)exg′(−1)=0

Keep exploring

Open the steps in Math: the Checker marks every row ✓. Change the minus in 2⁢xcosx−x2sinx to a plus and that row reads ✗.

Return to the concept →
Sources and scope

Authored study material. Tool results depend on the stated inputs and model assumptions.

After reading

Study it, then try it

Practice the key terms as flashcards, then open the example in its tool, change a value and keep a useful result on your board.

Study the 4 key terms Check the derivative in Math Open worked example on a board Product rule in Math Reference

Your existing work stays on this device. Examples open as editable copies.