How do you differentiate the function $f(x)=x\sin x+\cos x$?
Answer
614.1k+ views
Hint: In this question we have the addition of trigonometric terms. In the function the first term is $x\sin x$ which is a composite function therefore, we will first solve this term by using the formula of $\dfrac{d}{dx}uv=u\dfrac{dv}{dx}+v\dfrac{du}{dx}$ and then substitute it in the original function and then derivate the remaining term $\cos x$ to get the final solution.
Complete step-by-step solution:
We have the expression as:
$\Rightarrow f(x)=x\sin x+\cos x$
We have to find the derivative of the expression therefore; it can be written as:
$\Rightarrow f'(x)=\dfrac{d}{dx}\left( x\sin x+\cos x \right)$
Now since the terms are in addition, we can split the derivative as:
$\Rightarrow f'(x)=\dfrac{d}{dx}x\sin x+\dfrac{d}{dx}\cos x\to (1)$
Now consider the term $\dfrac{d}{dx}x\sin x$. Since there is no direct way to differentiate this, we will use the formula of derivative of $uv$ which is $\dfrac{d}{dx}uv=u\dfrac{dv}{dx}+v\dfrac{du}{dx}$. We will consider $u=x$ and $v=\sin x$.
On using the formula, we get:
$\Rightarrow \dfrac{d}{dx}x\sin x=x\dfrac{d}{dx}\sin x+\sin x\dfrac{dx}{dx}$
Now we know that $\dfrac{dx}{dx}=1$ and $\dfrac{d}{dx}\sin x=\cos x$, on substituting, we get:
$\Rightarrow \dfrac{d}{dx}x\sin x=x\times \cos x+\sin x\times 1$
On simplifying, we get:
$\Rightarrow \dfrac{d}{dx}x\sin x=x\cos x+\sin x$
On substituting the value in equation $(1)$, we get:
$\Rightarrow f'(x)=x\cos x+\sin x+\dfrac{d}{dx}\cos x$
Now we know that $\dfrac{d}{dx}\cos x=-\sin x$ therefore, on substituting, we get:
$\Rightarrow f'(x)=x\cos x+\sin x-\sin x$
Since the same term with opposite sign cancel each other, we can write the expression as: $\Rightarrow f'(x)=x\cos x$, which is the required solution.
Note: In this question we have used the $\dfrac{d}{dx}uv$ formula which is for two terms which are in multiplication. There also exists the formula for two terms in division which can be denoted as $\dfrac{d}{dx}\dfrac{u}{v}$ and the formula is written as $\dfrac{d}{dx}\dfrac{u}{v}=\dfrac{v\dfrac{du}{dx}-u\dfrac{dv}{dx}}{{{v}^{2}}}$. It is to be remembered that $\dfrac{d}{dx}{{x}^{n}}=n{{x}^{n-1}}$, which is the derivation of the formula of $\dfrac{dx}{dx}=1$.
Consider the term $\dfrac{dx}{dx}$ , now $x$ can be written as ${{x}^{1}}$ therefore on differentiating, we get $1\times {{x}^{1-1}}$ which means ${{x}^{0}}$. Now we know that anything raised to $0$ is $1$ therefore, $\dfrac{dx}{dx}=1$.
Complete step-by-step solution:
We have the expression as:
$\Rightarrow f(x)=x\sin x+\cos x$
We have to find the derivative of the expression therefore; it can be written as:
$\Rightarrow f'(x)=\dfrac{d}{dx}\left( x\sin x+\cos x \right)$
Now since the terms are in addition, we can split the derivative as:
$\Rightarrow f'(x)=\dfrac{d}{dx}x\sin x+\dfrac{d}{dx}\cos x\to (1)$
Now consider the term $\dfrac{d}{dx}x\sin x$. Since there is no direct way to differentiate this, we will use the formula of derivative of $uv$ which is $\dfrac{d}{dx}uv=u\dfrac{dv}{dx}+v\dfrac{du}{dx}$. We will consider $u=x$ and $v=\sin x$.
On using the formula, we get:
$\Rightarrow \dfrac{d}{dx}x\sin x=x\dfrac{d}{dx}\sin x+\sin x\dfrac{dx}{dx}$
Now we know that $\dfrac{dx}{dx}=1$ and $\dfrac{d}{dx}\sin x=\cos x$, on substituting, we get:
$\Rightarrow \dfrac{d}{dx}x\sin x=x\times \cos x+\sin x\times 1$
On simplifying, we get:
$\Rightarrow \dfrac{d}{dx}x\sin x=x\cos x+\sin x$
On substituting the value in equation $(1)$, we get:
$\Rightarrow f'(x)=x\cos x+\sin x+\dfrac{d}{dx}\cos x$
Now we know that $\dfrac{d}{dx}\cos x=-\sin x$ therefore, on substituting, we get:
$\Rightarrow f'(x)=x\cos x+\sin x-\sin x$
Since the same term with opposite sign cancel each other, we can write the expression as: $\Rightarrow f'(x)=x\cos x$, which is the required solution.
Note: In this question we have used the $\dfrac{d}{dx}uv$ formula which is for two terms which are in multiplication. There also exists the formula for two terms in division which can be denoted as $\dfrac{d}{dx}\dfrac{u}{v}$ and the formula is written as $\dfrac{d}{dx}\dfrac{u}{v}=\dfrac{v\dfrac{du}{dx}-u\dfrac{dv}{dx}}{{{v}^{2}}}$. It is to be remembered that $\dfrac{d}{dx}{{x}^{n}}=n{{x}^{n-1}}$, which is the derivation of the formula of $\dfrac{dx}{dx}=1$.
Consider the term $\dfrac{dx}{dx}$ , now $x$ can be written as ${{x}^{1}}$ therefore on differentiating, we get $1\times {{x}^{1-1}}$ which means ${{x}^{0}}$. Now we know that anything raised to $0$ is $1$ therefore, $\dfrac{dx}{dx}=1$.
Recently Updated Pages
Which of the following graphs shows the variation of class 12 physics CBSE

Draw a labelled diagram of the human male reproductive class 12 biology CBSE

Describe the experiment to compare the emf of two cells class 12 physics CBSE

What is standard hydrogen electrode

What is conventional current and electric current class 12 physics CBSE

2Bromopentane is treated with an alcoholic KOH solution class 12 chemistry CBSE

Trending doubts
Draw a labelled sketch of the human eye class 12 physics CBSE

Which are the Top 10 Largest Countries of the World?

A member of Simon commission later became Prime Minister class 12 social science CBSE

Draw ray diagrams each showing i myopic eye and ii class 12 physics CBSE

Give one example of a reptile that is viviparous class 12 biology CBSE

Which is the correct genotypic ratio of mendel dihybrid class 12 biology CBSE

