Class 12 Maths, Worked in Full Past papersGet updates
CBSE Sample Paper 2025-26 · Section D · 5 marks

Q34: Solve y+ddx(xy)=x(sin⁡x+x)y + \frac{d}{dx}(xy) = x(\sin x + x)⁠, or the particular solution of 2yex/ydx+(y−2xex/y)dy=02ye^{x/y}dx + (y - 2xe^{x/y})dy = 0

The question

(a) Solve the differential equation: y+ddx(xy)=x(sin⁡x+x)y + \dfrac{d}{dx}(xy) = x(\sin x + x)

OR

(b) Find the particular solution of the differential equation:

2yex/ydx+(y−2xex/y) dy=02ye^{x/y}dx + (y - 2xe^{x/y})\,dy = 0

given that y(0)=1y(0) = 1

Exam answer

(a)

y+ddx(xy)=x(sin⁡x+x)⇒ y+(xdydx+y)=x(sin⁡x+x)⇒ 2y+xdydx=x(sin⁡x+x)⇒ dydx+2xy=sin⁡x+x\begin{aligned} &y + \frac{d}{dx}(xy) = x(\sin x + x) \\ \Rightarrow\ &y + \left(x\frac{dy}{dx} + y\right) = x(\sin x + x) \\ \Rightarrow\ &2y + x\frac{dy}{dx} = x(\sin x + x) \\ \Rightarrow\ &\frac{dy}{dx} + \frac{2}{x}y = \sin x + x \end{aligned}
Why?

ddx(xy)\frac{d}{dx}(xy) needs the product rule, since both xx and yy change:

ddx(xy)=xdydx+y\frac{d}{dx}(xy) = x\frac{dy}{dx} + y

Then collect y+y=2yy + y = 2y⁠, and divide every term by xx so that dydx\frac{dy}{dx} stands alone.

xxdydx+2yx=x(sin⁡x+x)xdydx+2xy=sin⁡x+x\begin{aligned} &\frac{x}{x}\frac{dy}{dx} + \frac{2y}{x} = \frac{x(\sin x + x)}{x} \\ &\frac{dy}{dx} + \frac{2}{x}y = \sin x + x \end{aligned}

This is a linear differential equation of the form dydx+Py=Q\frac{dy}{dx} + Py = Q⁠, with P=2xP = \frac{2}{x}⁠, Q=sin⁡x+xQ = \sin x + x⁠.

Why?

It is linear because yy and dydx\frac{dy}{dx} appear only to the first power, and PP and QQ are functions of xx alone.

I.F.=e∫2xdx=e2log⁡x=elog⁡x2=x2\text{I.F.} = e^{\int\frac{2}{x}dx} = e^{2\log x} = e^{\log x^2} = x^2
Why?

The integrating factor is e∫P dxe^{\int P\,dx}⁠. Here ∫2x dx=2log⁡x\int\frac{2}{x}\,dx = 2\log x⁠, and 2log⁡x=log⁡x22\log x = \log x^2⁠.

Then elog⁡a=ae^{\log a} = a⁠, because exe^x and log⁡x\log x undo each other.

The solution is y⋅I.F.=∫Q⋅I.F. dxy\cdot\text{I.F.} = \displaystyle\int Q\cdot\text{I.F.}\,dx⁠:

yx2=∫(sin⁡x+x)x2 dx=∫x2sin⁡x dx+∫x3 dx\begin{aligned} yx^2 &= \int(\sin x + x)x^2\,dx \\ &= \int x^2\sin x\,dx + \int x^3\,dx \end{aligned}
Why?

Multiplying the equation by the I.F. makes the left side an exact derivative:

x2dydx+2xy=ddx(x2y)\begin{aligned} &x^2\frac{dy}{dx} + 2xy \\ &= \frac{d}{dx}(x^2y) \end{aligned}

So integrating both sides gives the solution formula. Then multiply out: (sin⁡x+x)x2=x2sin⁡x+x3(\sin x + x)x^2 = x^2\sin x + x^3⁠.

Integrating by parts (x2x^2 as the first function),

∫x2sin⁡x dx=x2(−cos⁡x)−∫2x(−cos⁡x) dx\begin{aligned} &\int x^2\sin x\,dx \\ &= x^2(-\cos x) - \int 2x(-\cos x)\,dx \end{aligned}
Why?

By parts:

∫uv dx=u∫v dx−∫(u′∫v dx)dx\begin{aligned} \int uv\,dx &= u\int v\,dx \\ &\quad - \int\left(u'\int v\,dx\right)dx \end{aligned}

Take u=x2u = x^2⁠, because differentiating lowers its power: u′=2xu' = 2x⁠. Take v=sin⁡xv = \sin x⁠, with ∫sin⁡x dx=−cos⁡x\int\sin x\,dx = -\cos x⁠.

yx2=−x2cos⁡x+2∫xcos⁡x dx+x44+C\begin{aligned} yx^2 &= -x^2\cos x + 2\int x\cos x\,dx \\ &\quad + \frac{x^4}{4} + C \end{aligned}
Why?

The two minus signs make a plus: −∫2x(−cos⁡x) dx=2∫xcos⁡x dx-\int 2x(-\cos x)\,dx = 2\int x\cos x\,dx⁠.

By the power rule, ∫x3 dx=x44\int x^3\,dx = \frac{x^4}{4}⁠. One constant CC is enough for the whole right side.

Again by parts (xx as the first function),

∫xcos⁡x dx=xsin⁡x−∫1⋅sin⁡x dx=xsin⁡x+cos⁡x\begin{aligned} &\int x\cos x\,dx \\ &= x\sin x - \int 1\cdot\sin x\,dx \\ &= x\sin x + \cos x \end{aligned}
Why?

Now u=xu = x⁠, u′=1u' = 1⁠, and v=cos⁡xv = \cos x with ∫cos⁡x dx=sin⁡x\int\cos x\,dx = \sin x⁠.

Then ∫sin⁡x dx=−cos⁡x\int\sin x\,dx = -\cos x⁠, so subtracting it gives +cos⁡x+\cos x⁠.

xsin⁡x−∫sin⁡x dx=xsin⁡x−(−cos⁡x)=xsin⁡x+cos⁡x\begin{aligned} &x\sin x - \int\sin x\,dx \\ &= x\sin x - (-\cos x) \\ &= x\sin x + \cos x \end{aligned}

(The constant is already in CC⁠.)

So

yx2=−x2cos⁡x+2(xsin⁡x+cos⁡x)+x44+C\begin{aligned} yx^2 &= -x^2\cos x \\ &\quad + 2(x\sin x + \cos x) \\ &\quad + \frac{x^4}{4} + C \end{aligned}
Why?

This is the general solution: it has one arbitrary constant CC⁠, as a first-order equation should. Dividing by x2x^2 would give yy explicitly, but this form is accepted.

This is the required (general) solution.

(b)

2yex/y dx=(2xex/y−y) dy2ye^{x/y}\,dx = (2xe^{x/y} - y)\,dy
Why?

Move the dydy term to the other side and change its sign: −(y−2xex/y)=2xex/y−y-(y - 2xe^{x/y}) = 2xe^{x/y} - y⁠.

dxdy=2xex/y−y2yex/y=2xyex/y−12ex/y\begin{aligned} \frac{dx}{dy} &= \frac{2xe^{x/y} - y}{2ye^{x/y}} \\ &= \frac{2\frac{x}{y}e^{x/y} - 1}{2e^{x/y}} \end{aligned}
Why?

The equation contains ex/ye^{x/y}⁠, so it is easier to treat xx as a function of yy and write dxdy\frac{dx}{dy}⁠.

Dividing the top and the bottom by yy shows that dxdy\frac{dx}{dy} depends only on xy\frac{x}{y}⁠. That is what homogeneous means here.

top÷y:2xex/yy−yy=2xyex/y−1bottom÷y:2yex/yy=2ex/y\begin{aligned} \text{top} \div y&: \frac{2xe^{x/y}}{y} - \frac{y}{y} \\ &= 2\frac{x}{y}e^{x/y} - 1 \\[4pt] \text{bottom} \div y&: \frac{2ye^{x/y}}{y} = 2e^{x/y} \end{aligned}

It is a homogeneous differential equation. Let x=vy⇒dxdy=v+ydvdyx = vy \Rightarrow \frac{dx}{dy} = v + y\frac{dv}{dy}⁠.

Why?

With x=vyx = vy⁠, the ratio xy\frac{x}{y} is just vv⁠. Both vv and yy vary, so the product rule gives

ddy(vy)=v+ydvdy\frac{d}{dy}(vy) = v + y\frac{dv}{dy}
v+ydvdy=2vev−12ev⇒ydvdy=2vev−12ev−v=2vev−1−2vev2ev=−12ev⇒2ev dv=−dyy\begin{aligned} v + y\frac{dv}{dy} &= \frac{2ve^v - 1}{2e^v} \\ \Rightarrow y\frac{dv}{dy} &= \frac{2ve^v - 1}{2e^v} - v \\ &= \frac{2ve^v - 1 - 2ve^v}{2e^v} \\ &= \frac{-1}{2e^v} \\ \Rightarrow 2e^v\,dv &= -\frac{dy}{y} \end{aligned}
Why?

First put xy=v\frac{x}{y} = v into the right side, then subtract vv from both sides.

Write vv as 2vev2ev\frac{2ve^v}{2e^v} to subtract it with a common denominator. The 2vev2ve^v terms cancel.

2vev−12ev−2vev2ev=2vev−1−2vev2ev=−12ev\begin{aligned} &\frac{2ve^v - 1}{2e^v} - \frac{2ve^v}{2e^v} \\ &= \frac{2ve^v - 1 - 2ve^v}{2e^v} = \frac{-1}{2e^v} \end{aligned}

Then separate the variables, vv with dvdv and yy with dydy⁠: multiply both sides by 2evy dy\frac{2e^v}{y}\,dy⁠.

ydvdy⋅2evy dy=2ev dv−12ev⋅2evy dy=−dyy\begin{aligned} y\frac{dv}{dy} \cdot \frac{2e^v}{y}\,dy &= 2e^v\,dv \\ \frac{-1}{2e^v} \cdot \frac{2e^v}{y}\,dy &= -\frac{dy}{y} \end{aligned}

Integrating both sides,

∫2ev dv=−∫dyy⇒2ev=−log⁡∣y∣+C⇒2ex/y+log⁡∣y∣=C\begin{aligned} \int 2e^v\,dv &= -\int\frac{dy}{y} \\ \Rightarrow 2e^v &= -\log|y| + C \\ \Rightarrow 2e^{x/y} + \log|y| &= C \end{aligned}
Why?

Standard integrals: ∫ev dv=ev\int e^v\,dv = e^v and ∫dyy=log⁡∣y∣\int\frac{dy}{y} = \log|y|⁠.

Then put v=xyv = \frac{x}{y} back, and move log⁡∣y∣\log|y| to the left.

When x=0x = 0⁠, y=1y = 1⁠: 2e0+log⁡1=C2e^0 + \log 1 = C⁠, so C=2C = 2⁠.

Why?

y(0)=1y(0) = 1 means y=1y = 1 when x=0x = 0⁠. Then xy=0\frac{x}{y} = 0⁠, e0=1e^0 = 1 and log⁡1=0\log 1 = 0⁠, so C=2+0=2C = 2 + 0 = 2⁠.

∴\therefore The required solution is 2ex/y+log⁡∣y∣=22e^{x/y} + \log|y| = 2⁠.

Where this comes from

Chapter 9, Differential Equations: Linear and homogeneous differential equations.

Question type: (a) Linear equations + Integration by parts (combined); (b) Homogeneous equations + A particular solution (combined)

How to spot it: click to see

(a) Ch 9, type 7. Linear equations: the integrating factor

Spot it: dydx+Py=Q\frac{dy}{dx} + Py = Q⁠, with PP and QQ in xx only, and yy only to power 1.

Here: Expand ddx(xy)=xdydx+y\frac{d}{dx}(xy) = x\frac{dy}{dx} + y⁠, then divide by xx⁠: dydx+2xy=sin⁡x+x\frac{dy}{dx} + \frac{2}{x}y = \sin x + x⁠. So I.F.=x2\text{I.F.} = x^2⁠.

(a) Ch 7, type 8. Integration by parts: a product of two different kinds

Spot it: a product such as xsin⁡xx\sin x⁠, xexxe^x or xlog⁡xx\log x⁠. A lone log⁡x\log x or tan⁡−1x\tan^{-1}x works too: take the other function as 1.

Here: The right side needs ∫x2sin⁡x dx\int x^2\sin x\,dx⁠: a power times a trig function, so integrate by parts twice, with x2x^2 and then xx as the first function.

(b) Ch 9, type 6. Homogeneous equations: put y=vxy = vx

Spot it: every term has the same degree, like x2x^2⁠, xyxy and y2y^2⁠, or you see yx\frac{y}{x} inside sin, cos or log. You cannot separate xx and yy⁠.

Here: xy\frac{x}{y} sits inside ex/ye^{x/y}⁠, so write dxdy=2xyex/y−12ex/y\frac{dx}{dy} = \frac{2\frac{x}{y}e^{x/y} - 1}{2e^{x/y}} and put x=vyx = vy⁠. The vv terms cancel, leaving 2ev dv=−dyy2e^v\,dv = -\frac{dy}{y}⁠.

(b) Ch 9, type 4. A particular solution: solve, then find CC

Spot it: a condition such as "y=1y = 1 when x=0x = 0", or "the curve passes through a point".

Here: Then y(0)=1y(0) = 1 gives 2e0+log⁡1=C2e^0 + \log 1 = C⁠, so C=2C = 2⁠.

Found an error?

Tell us if something on this page is wrong or unclear. Send feedback on this question →