MethodMath
Ask
Join
HomeTopicsAskAlerts
Profile

© 2026 MethodMath. Built for mathematical knowledge sharing.

AboutContactGuidelinesPrivacyTermsCookies
Isabella Moreno
May 15, 2026

How to solve a first-order linear ODE using an integrating factor?

I'm studying differential equations and I keep making mistakes when using the integrating factor method.

For a first-order linear ODE of the form:

dydx+P(x)y=Q(x)\frac{dy}{dx} + P(x)y = Q(x)dxdy​+P(x)y=Q(x)

The standard approach is to multiply both sides by the integrating factor μ(x)=e∫P(x) dx\mu(x) = e^{\int P(x) \, dx}μ(x)=e∫P(x)dx.

But why does this work? And what is the systematic procedure for a problem like:

dydx+2xy=x,y(0)=1\frac{dy}{dx} + 2xy = x, \quad y(0) = 1dxdy​+2xy=x,y(0)=1
1 answers340 views

1 Answer

3
Nour Hassan
May 16, 2026
Accepted
Here is the complete solution with explanation of why the method works. **Why the Integrating Factor Works:** The left side $y' + P(x)y$ looks almost like the derivative of a product. If we multiply by $\mu(x) = e^{\int P \, dx}$, notice that: $$\frac{d\mu}{dx} = \mu \cdot P$$ Therefore: $$\frac{d}{dx}(\mu y) = \mu y' + \mu' y = \mu y' + \mu P y = \mu(y' + Py) = \mu Q$$ The ODE becomes $\frac{d}{dx}(\mu y) = \mu Q$, which integrates directly. **Systematic Procedure for $y' + 2xy = x$, $y(0) = 1$:** **Step 1:** Identify $P(x) = 2x$ and $Q(x) = x$. **Step 2:** Compute the integrating factor: $$\mu(x) = e^{\int 2x \, dx} = e^{x^2}$$ **Step 3:** Multiply both sides: $$e^{x^2} y' + 2x e^{x^2} y = x e^{x^2}$$ $$\frac{d}{dx}\left(e^{x^2} y\right) = x e^{x^2}$$ **Step 4:** Integrate both sides: $$e^{x^2} y = \int x e^{x^2} \, dx$$ Substitute $u = x^2$, $du = 2x \, dx$: $$\int x e^{x^2} \, dx = \frac12 \int e^u \, du = \frac12 e^{x^2} + C$$ So: $$e^{x^2} y = \frac12 e^{x^2} + C \quad \Rightarrow \quad y = \frac12 + Ce^{-x^2}$$ **Step 5:** Apply initial condition $y(0) = 1$: $$1 = \frac12 + C \quad \Rightarrow \quad C = \frac12$$ **Final solution:** $$\boxed{y(x) = \frac12\left(1 + e^{-x^2}\right)}$$
1 comment
Raj Patel
Raj PatelMay 16, 2026

The signed volume interpretation is so much more satisfying than the algebraic formula. Great explanation.

Still unsure? Join to comment or ask a follow-up.
Login or Register to post your answer

Suggested questions

Why does 0 factorial equal 1 instead of 0? Simple proof

31.4k

How many squares are actually in an 8 by 8 chessboard?

22.2k

How to solve a linear programming problem using the simplex method?

2956

Does the Banach-Steinhaus theorem hold for non-complete normed spaces?

31.1k

Do I need Calculus 3 before learning Fourier series?

3499