Skip to content
Exercise 9.4 · Q2

Q.Solve the following differential equation: y′=x+yxy' = \frac{x+y}{x}

Punjab PsebTextbookSubjective· 3mImportance★★★★★
30% · 67/222 Questions
✓ Free question

This is a first-order linear ODE that simplifies to y′−yx=1y' - \frac{y}{x} = 1. Using an integrating factor μ=1x\mu = \frac{1}{x}, the general solution is y=xlog⁡∣x∣+Cxy = x \log|x| + Cx.

The key here is to recognize that the right-hand side x+yx\frac{x+y}{x} can be split into two simpler terms: 1+yx1 + \frac{y}{x}. That immediately reveals the equation is not separable in its current form, but it is linear in yy.

An Initial Value Problem (IVP) isn’t given here — we’re just solving the differential equation generally. But the approach for a first-order linear ODE is always the same: rewrite it as y′+P(x)y=Q(x)y' + P(x)y = Q(x), then multiply through by an integrating factor μ(x)=e∫P(x) dx\mu(x) = e^{\int P(x)\,dx} to make the left side a perfect derivative.

Let’s walk through it.

  1. Rewrite the equation in standard linear form. Start with y′=x+yx=1+yxy' = \frac{x+y}{x} = 1 + \frac{y}{x}. Bring the yy term to the left:

y′−yx=1.y' - \frac{y}{x} = 1.

So here P(x)=−1xP(x) = -\frac{1}{x} and Q(x)=1Q(x) = 1.

  1. Find the integrating factor. Compute ∫P(x) dx=∫−1x dx=−log⁡∣x∣=log⁡∣x∣−1\int P(x)\,dx = \int -\frac{1}{x}\,dx = -\log|x| = \log|x|^{-1}. Then the integrating factor is:

μ(x)=e∫P dx=elog⁡∣x∣−1=1∣x∣.\mu(x) = e^{\int P\,dx} = e^{\log|x|^{-1}} = \frac{1}{|x|}.

For simplicity, we usually take μ(x)=1x\mu(x) = \frac{1}{x} (assuming x>0x>0; the absolute value can be handled later with a sign).

Integrating factor for y′−yx=1y' - \frac{y}{x} = 1 is μ(x)=1x\mu(x) = \frac{1}{x}.

  1. Multiply the entire equation by μ(x)\mu(x).

1xy′−1x2y=1x.\frac{1}{x} y' - \frac{1}{x^2} y = \frac{1}{x}.

Notice the left side is exactly the derivative of yx\frac{y}{x}:

ddx(yx)=1xy′−yx2.\frac{d}{dx}\left( \frac{y}{x} \right) = \frac{1}{x} y' - \frac{y}{x^2}.

So the equation becomes:

ddx(yx)=1x.\frac{d}{dx}\left( \frac{y}{x} \right) = \frac{1}{x}.

  1. Integrate both sides.

yx=∫1x dx=log⁡∣x∣+C,\frac{y}{x} = \int \frac{1}{x}\,dx = \log|x| + C,

where CC is the constant of integration.

  1. Solve for yy. Multiply through by xx:

y=xlog⁡∣x∣+Cx.y = x \log|x| + Cx.

Tip

If you ever forget the integrating factor method, you can also treat this as a homogeneous equation (set y=vxy = vx) — try it: y′=v+xv′y' = v + xv', then v+xv′=1+vv + xv' = 1 + v gives xv′=1xv' = 1, leading to the same result.

Watch out

A common mistake is to forget the absolute value inside log⁡∣x∣\log|x| when integrating 1x\frac{1}{x}. For x>0x>0, you can drop the absolute value; for x<0x<0, the sign is absorbed into the constant CC anyway. But in exams, writing log⁡∣x∣\log|x| is safest.

✓Final answer

The general solution is y=xlog⁡∣x∣+Cxy = x \log|x| + Cx, where CC is an arbitrary constant.

Unlock everything free for 14 days

  • Full step-by-step solutions
  • Concept-first explanations
  • Methods, shortcuts & mistakes
  • PYQ mapping + timed mock tests

Full access for 14 days. No credit card required.