Solve dy/dx = y/x given y(1)=2

easy CBSE JEE-MAIN 3 min read

Question

Solve the differential equation dydx=yx\dfrac{dy}{dx} = \dfrac{y}{x}, given the initial condition y(1)=2y(1) = 2.

Solution — Step by Step

This is a separable differential equation — we can separate variables so that all yy terms are on one side and all xx terms are on the other.

Rewrite:

dydx=yx\frac{dy}{dx} = \frac{y}{x}

Separate variables:

dyy=dxx\frac{dy}{y} = \frac{dx}{x}
dyy=dxx\int \frac{dy}{y} = \int \frac{dx}{x} lny=lnx+C\ln|y| = \ln|x| + C

where CC is the constant of integration.

lnylnx=C\ln|y| - \ln|x| = C lnyx=C\ln\left|\frac{y}{x}\right| = C

Exponentiating both sides:

yx=eC\left|\frac{y}{x}\right| = e^C

Since eCe^C is just a positive constant, let A=±eCA = \pm e^C (absorbing the absolute value), so:

yx=A    y=Ax\frac{y}{x} = A \implies y = Ax

This is the general solution: y=Axy = Ax for some constant AA.

We’re told y(1)=2y(1) = 2, meaning when x=1x = 1, y=2y = 2. Substitute:

2=A×1    A=22 = A \times 1 \implies A = 2

Particular solution:

y=2x\boxed{y = 2x}

Check: dy/dx=2dy/dx = 2. And y/x=2x/x=2y/x = 2x/x = 2. ✓

Check initial condition: y(1)=2(1)=2y(1) = 2(1) = 2. ✓

Why This Works

The equation dy/dx=y/xdy/dx = y/x is saying: the rate of change of yy with respect to xx is proportional to the ratio y/xy/x. This type of relationship arises in problems where growth is proportional to current value relative to some baseline.

The separation of variables technique works whenever we can write the equation as f(y)dy=g(x)dxf(y)dy = g(x)dx. We then integrate both sides independently — each side depends on only one variable.

Alternative Method

We can also recognise this as a homogeneous differential equation (degree 0 in xx and yy). Substitute y=vxy = vx where v=y/xv = y/x:

y=vx    dy/dx=v+x(dv/dx)y = vx \implies dy/dx = v + x(dv/dx)

v+xdvdx=v    xdvdx=0    dv/dx=0v + x\frac{dv}{dx} = v \implies x\frac{dv}{dx} = 0 \implies dv/dx = 0

So v=constantv = \text{constant}, i.e., y/x=constanty/x = \text{constant}, confirming y=Axy = Ax.

This method is overkill for this equation but is the standard approach for harder homogeneous equations.

Common Mistake

A common error is integrating to get y2/2=x2/2+Cy^2/2 = x^2/2 + C — this happens when students integrate ydyy\,dy instead of dy/ydy/y. The correct integral of 1/y1/y with respect to yy is lny\ln|y|, not y2/2y^2/2. Always check whether you have dy/ydy/y or ydyy\,dy before integrating.

Want to master this topic?

Read the complete guide with more examples and exam tips.

Go to full topic guide →

Try These Next