Courses
Courses for Kids
Free study material
Offline Centres
More
Store Icon
Store
seo-qna
SearchIcon
banner

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

Answer
VerifiedVerified
524.7k+ views
Hint: To find the derivative of the given expression, we are going to use the product rule in $x\sin x$. We know that in the product rule, let us take two functions $f\left( x \right)\And g\left( x \right)$ and multiply them then we are going to use the product rule as follows: $\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: $\dfrac{d\sin x}{dx}=\cos x$ and $\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=x\sin x+\cos x$
Taking derivative with respect to x on both the sides we get,
$\dfrac{dy}{dx}=\dfrac{d\left( x\sin x+\cos x \right)}{dx}$
Distributing the derivative in both the functions $x\sin x\And \cos x$ and we get,
$\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 $x\sin x$ with respect to x. In the below, we are showing the product rule by using two functions $f\left( x \right)\And g\left( x \right)$ as follows:
$\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\left( x \right)=x$ and $g\left( x \right)=\sin x$ in the above differentiation and we get,
\[\dfrac{d\left( x\sin x \right)}{dx}=x\left( \sin x \right)'+\sin x\left( x \right)'\]
We know the derivative of $\sin x$ with respect to x is $\cos x$ and the derivative of $x$ with respect to $x$ is 1 so applying these derivatives in the above we get,
\[\begin{align}
  & \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{align}\]
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.