# Linear equation

## Solving first order linear differential equations

• A first order DE is linear, if it can be written of the form $\frac{\mathrm dy}{\mathrm dx}+P(x)y=Q(x)$ for some functions $$P(x),Q(x)$$.
• To solve this equation, we introduce an integrating factor $$I(x)$$.
• We assume that both sides of the DE$$\cdot I(x)$$ are equal to $$(I(x)y)'$$: $I(x)(y'+P(x)y)=(I(x)y)'=Q(x).$
• The left equality shows how to find $$I(x)$$: expanding it we get $I(x)y'+P(x)yI(x)=I'(x)y+I(x)y',$ that is $y(P(x)I(x)-I'(x))=0.$
• Since we don't want $$y=0$$ on any open interval, we need $P(x)I(x)=I'(x).$
• This is a separable DE: $\int P(x)\,\mathrm dx=\int I^{-1}\,\mathrm dI$ gives $\int P(x)\,\mathrm dx=\ln|I|.$
• Taking natural exponents, we get $I(x)=e^{\int P(x)\,\mathrm dx}.$
• Now let's look at the right equality: from $(I(x)y)'=I(x)Q(x)$ we get $I(x)y=\int I(x)Q(x)\,\mathrm dx,$ that is $y=e^{-\int P(x)\,\mathrm dx}\int I(x)Q(x)\,\mathrm dx.$
• Example: $$\frac{\mathrm dy}{\mathrm dx}+3x^2y=6x^2$$
• We have $$P(x)=3x^2$$ and $$Q(x)=6x^2$$.
• We get $I(x)=e^{\int P(x)\,\mathrm dx}=e^{x^3}$
• and thus $y=e^{-x^3}\int I(x)Q(x)\,\mathrm dx=e^{-x^3}(2e^{x^3}+C)=2+Ce^{-x^3}.$
• Exercises. 9.5: 1-4, 7, 9, 11, 17, 19