Solveeit Logo

Question

Question: How do you find the derivative of: \(y=x\sin x+\cos x\)...

How do you find the derivative of:
y=xsinx+cosxy=x\sin x+\cos x

Explanation

Solution

To find the derivative of the given expression, we are going to use the product rule in xsinxx\sin x. We know that in the product rule, let us take two functions f(x)&g(x)f\left( x \right)\And g\left( x \right) and multiply them then we are going to use the product rule as follows: d(f(x)g(x))dx=f(x)g(x)+g(x)f(x)\dfrac{d\left( f\left( x \right)g\left( x \right) \right)}{dx}=f\left( x \right)g'\left( x \right)+g\left( x \right)f'\left( x \right). Also, we need the derivative of the following functions: dsinxdx=cosx\dfrac{d\sin x}{dx}=\cos x and dcosxdx=sinx\dfrac{d\cos x}{dx}=-\sin x.

Complete step-by-step solution:
The function given in the above problem which we have to differentiate is as follows:
y=xsinx+cosxy=x\sin x+\cos x
Taking derivative with respect to x on both the sides we get,
dydx=d(xsinx+cosx)dx\dfrac{dy}{dx}=\dfrac{d\left( x\sin x+\cos x \right)}{dx}
Distributing the derivative in both the functions xsinx&cosxx\sin x\And \cos x and we get,
dydx=d(xsinx)dx+d(cosx)dx\dfrac{dy}{dx}=\dfrac{d\left( x\sin x \right)}{dx}+\dfrac{d\left( \cos x \right)}{dx} ……….. (1)
Now, we are going to use product rule to find the derivative of xsinxx\sin x with respect to x. In the below, we are showing the product rule by using two functions f(x)&g(x)f\left( x \right)\And g\left( x \right) as follows:
d(f(x)g(x))dx=f(x)g(x)+g(x)f(x)\dfrac{d\left( f\left( x \right)g\left( x \right) \right)}{dx}=f\left( x \right)g'\left( x \right)+g\left( x \right)f'\left( x \right)
Substituting f(x)=xf\left( x \right)=x and g(x)=sinxg\left( x \right)=\sin x in the above differentiation and we get,
d(xsinx)dx=x(sinx)+sinx(x)\dfrac{d\left( x\sin x \right)}{dx}=x\left( \sin x \right)'+\sin x\left( x \right)'
We know the derivative of sinx\sin x with respect to x is cosx\cos x and the derivative of xx with respect to xx is 1 so applying these derivatives in the above we get,

& \dfrac{d\left( x\sin x \right)}{dx}=x\cos x+\sin x\left( 1 \right) \\\ & \Rightarrow \dfrac{d\left( x\sin x \right)}{dx}=x\cos x+\sin x \\\ \end{aligned}$$ Now, using above relation in eq. (1) we get, $\dfrac{dy}{dx}=x\cos x+\sin x+\dfrac{d\left( \cos x \right)}{dx}$ We know that the derivative of $\cos x$ with respect to x is $-\sin x$ so using this derivative in the above equation and we get, $\dfrac{dy}{dx}=x\cos x+\sin x-\sin x$ Now, $\sin x$ will be cancelled out in the R.H.S of the above equation and we get, $\dfrac{dy}{dx}=x\cos x$ Hence, we have found the derivative of the given expression and the derivative is equal to $x\cos x$. **Note:** To solve the above problem, we need to have knowledge of product rule and the derivatives of $\sin x\And \cos x$. If you don’t know any of these derivatives then you cannot move forward in this problem so make sure you have properly grasped these concepts.