Derivative of x cos(x) with Proofs and Graphs

The x multiplied by cosine of x function is the product of the monomial function x and the trigonometric function of cosine. The derivative of x multiplied by the cosine of x is equal to the cosine of x and then subtracted to the quantity of x multiplied by the sine of x, cos(x) – xcos(x). We can prove this derivative using the product rule, implicit differentiation, quotient rule, trigonometric cosine function, or the inverse cosine function.

In this article, we will discuss how to derive the product of two functions, the monomial x and the trigonometric function cosine. We will cover brief fundamentals, its formula, a graph comparison of tangent and its derivative, a proof, methods to derive, and a few examples.

GEOMETRY
Derivative of x cosx

Relevant for

Learning how to find the derivative of x cos(x).

See proofs

GEOMETRY
Derivative of x cosx

Relevant for

Learning how to find the derivative of x cos(x).

See proofs

Proofs of the Derivative of x cos(x)

Listed below are the proofs of the derivative of \(x\cos{(x)}\). These proofs can also serve as the main methods of deriving this function.

Proof of the derivative of x cos(x) using the Product Rule formula

You can review the product rule formula by looking at this article: Product Rule of derivatives. You can also look at this article for the proof of the trigonometric cosine derivative using limits: Derivative of Cosine, cos(x).

Let’s have the derivative of the function

$$ f(x) = x\cos{(x)}$$

We can figure out the two functions being multiplied. In this case, it is a product of a monomial and a trigonometric cosine of angle x. Setting the first multiplicand/term as u, we have

$$ u = x$$

and setting the second multiplicand/term as v, we have

$$ v = \cos{(x)}$$

Recall that the derivative product formula is

$$ \frac{d}{dx} uv = u \frac{d}{dx} v + v \frac{d}{dx} u$$

That is, the function u times v is derived by multiplying u by the derivative of v and then added to v multiplied by the derivative of u. Applying this formula to our given function, we have

$$ \frac{d}{dx} uv = (x) \frac{d}{dx} (\cos{(x)}) + (\cos{(x)}) \frac{d}{dx} (x)$$

Evaluating the derivative of u by using power rule and v by using the derivative of cosine, we have

$$ \frac{d}{dx} uv = (x) \cdot (-\sin{(x)}) + (\cos{(x)}) \cdot (1)$$

Simplifying, we have

$$ \frac{d}{dx} uv = -((x) \cdot \sin{(x)}) + (\cos{(x)}) \cdot (1)$$

$$ \frac{d}{dx} uv = -x\sin{(x)} + \cos{(x)} $$

$$ \frac{d}{dx} uv = \cos{(x)} – x\sin{(x)} $$

As a result, we arrive at the \(x\cos{(x)}\) derivative formula.

$$ \frac{d}{dx} x\cos{(x)} = \cos{(x)} – x \sin{(x)}) $$

Proof of the derivative of x cos(x) using implicit differentiation through quotient rule and trigonmetric cosine function

You are advised to learn/review the derivative rule for quotients, the derivative of trigonometric function cosine, and implicit differentiation for this proof.

Given that the equation

$$ y = x\cos{(x)}$$

Cross multiplying the first multiplicand of the right hand side to the left hand side of the equation, we have

$$ \frac{y}{x} = \cos{(x)}$$

Evaluate the implicit differentiation in terms of x. We will use the quotient rule on the left hand side and the derivative of cosine on the right hand side.

$$ \frac{d}{dx} \left( \frac{y}{x} \right) = \frac{d}{dx} \cos{(x)}$$

Recall that the quotient rule formula is

$$ \frac{d}{dx} \left( \frac{u}{v} \right) = \frac{u \frac{d}{dx} v – v \frac{d}{dx} u}{v^2} $$

Applying this to the derivative of the left hand side of the equation, we have

$$ \frac{x \frac{dy}{dx} – y}{x^2} = \frac{d}{dx} \cos{(x)} $$

Deriving the right hand side of the equation, we have

$$ \frac{x \frac{dy}{dx} – y}{x^2} = -\sin{(x)} $$

Isolating \( \frac{dy}{dx} \), we have

$$ x \frac{dy}{dx} – y = x^2 (-\sin{(x)}) $$

$$ x \frac{dy}{dx} – y = -x^2\sin{(x)} $$

$$ x \frac{dy}{dx} = y – x^2 \sin{(x)} $$

$$ \frac{dy}{dx} = \frac{y – x^2 \sin{(x)}}{x} $$

$$ \frac{dy}{dx} = \frac{y}{x} – \frac{x^2\sin{(x)}}{x} $$

We recall from the beginning that \( y = x\cos{(x)} \). Substituting this to the y of our derivative, we have

$$ \frac{dy}{dx} = \frac{(x\cos{(x)})}{x} – \frac{x^2\sin{(x)}}{x} $$

Simplifying, we have

$$ \frac{dy}{dx} = \cos{(x)} – x\sin{(x)} $$

We now have the derivative of \( y = x\cos{(x)} \)

$$ y’ = \cos{(x)} – x \sin{(x)} $$

Proof of the derivative of x cos(x) using implicit differentiation through quotient rule and the inverse cosine function

You are advised to learn/review the chain rule formula, the derivative rule for quotients, the derivative of inverse cosine, and implicit differentiation for this proof.

Given that the equation

$$ y = x\cos{(x)}$$

Cross multiplying the first multiplicand of the right-hand side to the left-hand side of the equation, we have

$$ \frac{y}{x} = \cos{(x)}$$

Equate the equation in terms of the angle x of the cosine function. Doing this will involve the process of inverse cosine function.

$$ \cos^{-1}{\left( \frac{y}{x} \right)} = x$$

Evaluate the implicit differentiation in terms of x. We will use the chain rule formula on the left hand side involving the quotient rule and the derivative of inverse cosine; and then on the right hand side, a simple power rule.

$$ \frac{d}{dx} \left( \cos^{-1}{\left( \frac{y}{x} \right)} \right) = x$$

$$ \left( -\frac{1}{\sqrt{1-\left(\frac{y}{x}\right)^2}} \right) \cdot \left( \frac{x \frac{dy}{dx} – y}{x^2} \right) = 1$$

Isolating \( \frac{dy}{dx} \), we have

$$ -\frac{ \frac{x \frac{dy}{dx} – y}{x^2} }{ \sqrt{1-\left(\frac{y}{x}\right)^2} } = 1 $$

$$ -\frac{x \frac{dy}{dx} – y}{x^2} = \sqrt{1-\left(\frac{y}{x}\right)^2} $$

$$ -x \frac{dy}{dx} – y = x^2 \sqrt{1-\left(\frac{y}{x}\right)^2} $$

$$ -x \frac{dy}{dx} = x^2 \sqrt{1-\left(\frac{y}{x}\right)^2} + y $$

$$ \frac{dy}{dx} = -\frac{ x^2 \sqrt{1-\left(\frac{y}{x}\right)^2} + y }{x} $$

$$ \frac{dy}{dx} = -\frac{ x^2 \sqrt{1-\left(\frac{y}{x}\right)^2}}{x} + \frac{y}{x} $$

$$ \frac{dy}{dx} = \frac{y}{x} – \frac{ x^2 \sqrt{1-\left(\frac{y}{x}\right)^2}}{x} $$

We recall from the beginning that \( y = x\cos{(x)} \). Substituting this to the y of our derivative, we have

$$ \frac{dy}{dx} = \frac{x\cos{(x)}}{x} – \frac{ x^2 \sqrt{1-\left(\frac{x\cos{(x)}}{x}\right)^2}}{x} $$

Simplifying, we have

$$ \frac{dy}{dx} = \cos{(x)} – x \sqrt{1-\left(\cos{(x)}\right)^2} $$

$$ \frac{dy}{dx} = \cos{(x)} – x \sqrt{1 – \cos^{2}{(x)} } $$

Recall that we can apply a trigonometric identity here by using \( \sin^{2}{(x)} + \cos^{2}{(x)} = 1 \), also called the pythagorean formula for sines and cosines. Applying this identity, we have

$$ \frac{dy}{dx} = \cos{(x)} – x \sqrt{ \sin^{2}{(x)} } $$

$$ \frac{dy}{dx} = \cos{(x)} – x \sin{(x)} $$

Just like the first two proofs, we now have the derivative of \( y = x\cos{(x)} \)

$$ y’ = \cos{(x)} – x \sin{(x)} $$


How to derive the x cos(x)

Before we start on the step by step process and as a summary, the derivative of \( x\cos{(x)} \) is

$$ \frac{d}{dx} x\cos{(x)} = \cos{(x)} – x\sin{(x)} $$

Derivative of the x cos(x) using product rule

Step 1: Determine the two functions being multiplied. Mark the first multiplicand/term as u and the second as v.

$$ u = x $$

$$ v = \cos{(x)} $$

Step 2: Recall the product rule formula.

$$ \frac{d}{dx} f(x) = u \frac{d}{dx} v + v \frac{d}{dx} u $$

Step 3: Apply the product rule formula to derive \( x\cos(x) \).

$$ \frac{dy}{dx} = x \cdot \frac{d}{dx} \cos{(x)} + \cos{(x)} \cdot \frac{d}{dx} x $$

Step 4: Use the appropriate derivative formulas for u and v. In this case, use the power rule for the derivative of u and the derivative of cosine for the derivative of v.

$$ \frac{dy}{dx} = x \cdot (-\sin{(x)}) + \cos{(x)} \cdot (1) $$

Step 5: Simplify algebraically and apply some identities or laws only if applicable

$$ \frac{dy}{dx} = – x \sin{(x)} + \cos{(x)} $$

$$ \frac{dy}{dx} = \cos{(x)} – x \sin{(x)} $$

Step 6: Finalize the answer.

$$ \frac{d}{dx} x\cos{(x)} = \cos{(x)} – x \sin{(x)} $$


Graph of x cos(x) vs. its derivative

In the instance of this function

$$ f(x) = x\cos{(x)} $$

the graph is illustrated as

graph-of-fx-xcosx

And as we learned above, deriving \(f(x) = x\cos{(x)}\) will be

$$ f'(x) = \cos{(x)} – x \sin{(x)}$$

which is illustrated graphically as

graph-of-the-derivative-of-xcosx

Illustrating both graphs in one, we have

graph-of-xcosx-and-its-derivative

By examining the differences between these functions using these graphs, you can see that both the original function \(f(x) = x\cos{(x)}\) and its derivative \( f'(x) = \cos{(x)} – x \sin{(x)} \) have a similar domain of

\( (-\infty,\infty) \) or \( x | x \in \mathbb{R} \)

and both also lie within the range of

\( (-\infty,\infty) \) or \( y | y \in \mathbb{R} \)


Examples

The example below shows how to derive a variable multiplied by the cosine of the same variable using the product rule formula.

EXAMPLE 1

Derive: \(f(\beta) = \beta\cos{(\beta)}\)

Solution: Using the product rule formula, we have

Determine u and v.

$$ u = \beta $$

$$ v = \cos{(\beta)} $$

Recall and apply the product rule formula to derive \(\beta\cos{(\beta)}\)

$$ \frac{d}{d\beta} f(\beta) = u \frac{d}{d\beta} v + v \frac{d}{d\beta} u $$

$$ \frac{d}{d\beta} f(\beta) = \beta \frac{d}{d\beta} \cos{(\beta)} + \cos{(\beta)} \frac{d}{d\beta} \beta $$

Derive u and v in the product rule formula

$$ \frac{d}{d\beta} f(\beta) = \beta \cdot (-\sin{(\beta)}) + \cos{(\beta)} \cdot (1) $$

Simplify algebraically and apply some identities or laws only if applicable

$$ \frac{d}{d\beta} f(\beta) = – \beta \sin{(\beta)} + \cos{(\beta)} $$

The final answer is:

$$ \frac{d}{d\beta} \beta\sin{(\beta)} = \cos{(\beta)} – \beta \sin{(\beta)} + $$


See also

Interested in learning more about the derivatives of trigonometric functions times x? Take a look at these pages:

Learn mathematics with our additional resources in different topics

LEARN MORE