Solveeit Logo

Question

Question: Solve the given differential equation. \[y+\dfrac{d(xy)}{dx}=x(\sin x+\log x)\]...

Solve the given differential equation.
y+d(xy)dx=x(sinx+logx)y+\dfrac{d(xy)}{dx}=x(\sin x+\log x)

Explanation

Solution

Hint: To solve this question we will use the concept of linear differential equation. A linear differential equation is given by dydx+Py=Q\dfrac{dy}{dx}+Py=Q, where P and Q are both functions of x. And solution of it is given by y.IF=Qdxy.IF=\int{Qdx}, where IF is an Integrating factor.

Complete step-by-step solution -

Given; y+d(xy)dx=x(sinx+logx)y+\dfrac{d(xy)}{dx}=x(\sin x+\log x)
Differentiating with respect x using product rule of differentiation, the term given by d(xy)dx\dfrac{d(xy)}{dx}, we get,

& y+\dfrac{d(xy)}{dx}=x(\sin x+\log x) \\\ & \Rightarrow y+x\dfrac{dy}{dx}+y=x(\sin x+\log x) \\\ \end{aligned}$$ Now making necessary rearrangements we get, $$\Rightarrow 2y+x\dfrac{dy}{dx}=x(\sin x+\log x)$$ Dividing the above obtained expression by x on both the sides we get, $$\Rightarrow \dfrac{dy}{dx}+2\dfrac{y}{x}=\sin x+\log x$$ This is a linear differential equation. A linear differential equation is given by $$\dfrac{dy}{dx}+Py=Q$$, where P and Q are both functions of x. And solution of it is given by $$y.IF=\int{Qdx}$$, where IF is an Integrating factor. Comparing our equation from the standard form a linear differential equation we get, $$P=\dfrac{2}{x}$$ and $$Q=\sin x+\log x$$. The integrating factor IF is given by, $$IF={{e}^{\int{\dfrac{2}{x}dx}}}$$. Solving it we get, $$\begin{aligned} & IF={{e}^{\int{\dfrac{2}{x}dx}}} \\\ & \Rightarrow IF={{e}^{2\operatorname{logx}}} \\\ & \Rightarrow IF={{e}^{\log {{x}^{2}}}} \\\ & \Rightarrow IF={{x}^{2}} \\\ \end{aligned}$$ Therefore we obtain the integrating factor as $${{x}^{2}}$$. Hence the general solution is given by, $$\begin{aligned} & y.{{x}^{2}}=\int{(\sin x+\log x){{x}^{2}}dx+C} \\\ & \Rightarrow y.{{x}^{2}}=\int{{{x}^{2}}\operatorname{sinxdx}+\int{{{x}^{2}}\log xdx}+C} \\\ \end{aligned}$$ In above equation C is the constant of integration. Now proceeding for further calculation we get, Now we will first separately solve the term given as, $$\int{{{x}^{2}}\operatorname{sinxdx}}$$ Solving this we get, $$\begin{aligned} & \int{{{x}^{2}}\operatorname{sinxdx}}={{x}^{2}}(-\cos x)+\int{2x\cos xdx} \\\ & \Rightarrow \int{{{x}^{2}}\operatorname{sinxdx}}=-{{x}^{2}}\cos x+[(2x)\sin x-\int{2\sin xdx]} \\\ & \Rightarrow \int{{{x}^{2}}\operatorname{sinxdx}}=-{{x}^{2}}\cos x+2x\sin x+2\cos x \\\ \end{aligned}$$ Let $$\int{{{x}^{2}}\operatorname{sinxdx}}=-{{x}^{2}}\cos x+2x\sin x+2\cos x......(i)$$ Now we will separately solve the term given by, $$\int{{{x}^{2}}\log xdx}$$. Solving we get, $$\begin{aligned} & \int{{{x}^{2}}\log xdx}=\log x.\dfrac{{{x}^{3}}}{3}-\int{\dfrac{1}{x}.\dfrac{{{x}^{3}}}{3}}dx \\\ & \Rightarrow \int{{{x}^{2}}\log xdx}=\dfrac{{{x}^{3}}}{3}\log x-\dfrac{1}{3}\int{{{x}^{2}}dx} \\\ & \Rightarrow \int{{{x}^{2}}\log xdx}=\dfrac{{{x}^{3}}}{3}\log x-\dfrac{{{x}^{3}}}{9} \\\ \end{aligned}$$ Let us assume $$\int{{{x}^{2}}\log xdx}=\dfrac{{{x}^{3}}}{3}\log x-\dfrac{{{x}^{3}}}{9}.......(ii)$$ Now using the result obtained in equation (i) and equation (ii) in the solution of the above differential equation, we have, $$\begin{aligned} & y.{{x}^{2}}=-{{x}^{2}}\cos x+2x\sin x+2\cos x+\dfrac{{{x}^{3}}}{3}\log x-\dfrac{{{x}^{3}}}{9} \\\ & \Rightarrow y=-\cos x+\dfrac{2\sin x}{x}+\dfrac{2\cos x}{{{x}^{2}}}+\dfrac{x}{3}\log x-\dfrac{x}{9}+C{{x}^{-2}} \\\ \end{aligned}$$ So we get the required result, the solution of the given differential equation $$y+\dfrac{d(xy)}{dx}=x(\sin x+\log x)$$ as, $$y=-\cos x+\dfrac{2\sin x}{x}+\dfrac{2\cos x}{{{x}^{2}}}+\dfrac{x}{3}\log x-\dfrac{x}{9}+C{{x}^{-2}}$$. Note: The possibility of error in this question can be at the point where you can do calculation mistakes while solving the integration terms. Always go for assuming equation numbers when there are multiple and long terms in the solution.