4.2 KiB
The world is non-linear, many solutions, many paths to the solution. It's why linear equations play so nice. We just look down it's path and we will know that it's a straight line for eternity.
Linear equation:
a(x)\frac{ dy }{ dx }+b(x)y=f(x)
I'm calling this #de_L_type1
if we assume b(x)=a'(x)
it kinda starts to look like a product rule
a(x)y'+a'(x)y=f(x)=(ay)'
ay=\int f(x) \, dx
<-yay! We can find the solutions to y.
we can rewrite the linear equation in what's called standard form:
\frac{ dy }{ dx }+P(x)y=Q(x)
I'm calling this #de_L_type2 )
we will define a function \mu(x)
called the integration factor, also expressed as I(x)
Multiply both sides by \mu(x)
\mu(x) \frac{ dy }{ dx }+\underbrace{ \mu(x)P(x) }_{ \mu'(x) }y=\mu(x)Q(x)
Like shown above we imagine if \mu(x) P(x)=\mu'(x)
as it starts to look like the product rule again.
(\mu y)'=\mu(x)Q(x)
This is nice as now we can integrate both sides as usual and get a solution for y.
y=\frac{1}{\mu(x)}\int \mu(x)Q(x) \, dx
#remember
But what is \mu(x)
? How do we find it?
In order for \mu(x) P(x)=\mu'(x)
to be true, \frac{ d\mu }{ dx }=\mu(x)P(x)\Rightarrow \frac{ d\mu }{ \mu }=P(x)dx\Rightarrow\int \frac{d\mu}{\mu}=\int P(x) \, dx\Rightarrow\ \ln\mid \mu\mid=\int P(x) \, dx
I'm not sure why the professor allows the absolute value to be dropped in the following step, I think he said that he argues all solutions can be found even if we focus only where
\mu
is +, idk.
finally we get that \mu(x)=I(x)=e^{\int P(x) \, dx}\quad \Box
#remember
#end of lecture 2 #start of lecture 3
Examples of linear equations:
#ex #de_L_type2 Find the general solution to the equation:
(1+\sin(x))y'+2\cos(x)y=\tan(x)
let a(x)=1+sin(x)\qquad b(x)=2\cos(x)
we can see that b(x)\ne a'(x)
:( so we cant use #de_L_type1
let's rearrange it into standard form:
y'+\frac{{2\cos(x)}}{1+\sin(x)}=\frac{\tan(x)}{1+\sin(x)}
P(x):=\frac{2\cos(x)}{1+\sin(x)} \qquad Q(x)=\frac{\tan(x)}{1+\sin(x)}
then I(x)=e^{\int {2\cos(x)}/(1+\sin(x))\, dx}
let u=1+\sin(x) \qquad du=\cos(x)dx
I(x)=e^{\int \frac{2\cos(x)}{u} \, \frac{du}{\cos(x)}}
I(x)=e^{2\ln\mid u\mid}
I(x)=\mid u\mid^2
I(x)=\mid1+\sin(x)\mid^2
I(x)=(1+\sin(x))^2
y=\frac{1}{I(x)}\int I(x)Q(x) \, dx
y=\frac{1}{(1+\sin(x))^2}\int (\frac{(1+\sin(x))^2\tan(x)}{1+\sin(x)} \, dx
y=\frac{1}{(1+\sin(x))^2}\int \tan(x)+\frac{\sin^2(x)}{\cos(x)} \, dx
y=\frac{1}{(1+\sin(x))^2}(\ln\mid sec(x)\mid+\int \frac{\sin^2(x)}{\cos(x)} \, dx)
using u substitution doesnt work for the second integral because I got
\int\frac{\sin(x)}{u}du \qquad u=\cos(x)
could try using\sin^2(x)=\frac{{1-\cos(2x)}}{2}
but looks hard with the 2x term, let's try using\sin^2(x)=1-\cos^2(x)
instead. (also because I also remember this is what we used in class)
y=\frac{1}{(1+\sin(x))^2}(\ln\mid sec(x)\mid+\int \frac{1-\cos^2(x)}{\cos(x)} \, dx)
y=\frac{1}{(1+\sin(x))^2}(\ln\mid sec(x)\mid+\ln\mid sec(x)+\tan(x)\mid+\int -\cos(x) \, dx)
Albeit a bit ugly, we have found the general solution to the DE:
y=\frac{1}{(1+\sin(x))^2}(\ln\mid sec(x)\mid+\ln\mid sec(x)+\tan(x)\mid-\sin(x)+C)
#ex #IVP #de_L_type2
$y'+\tan(x)y=\cos^2(x) \qquad y\left( \frac{\pi}{4} \right)=\frac{1}{2}
$
Looks like a linear equation with an initial value.
P(x)=\tan(x) \qquad Q(x)=\cos^2(x) \qquad I(x)=e^{\int \tan(x) \, dx}
I(x)=e^{\ln\mid sec(x)\mid}
I(x)=\mid sec(x)\mid
I(x)=sec(x)
The prof simply drops the absolute value. I don't understand why. Sigma asf tbh. I think it's because he said linear DE are nice because their solutions are unique with an IVP, non linear equations are not necessarily unique. So if we find one solution we know that we found the only solution possible.
y=\cos(x)\int sec(x)\cos^2(x) \, dx
y=\cos(x)\int \cos(x) \, dx
y=cos(x)(sin(x)+C)
Now we issue the initial value:
\frac{1}{2}=\cos\left( \frac{\pi}{4} \right)\sin\left( \frac{\pi}{4}+C) \right)
\frac{\frac{1}{2}}{\frac{1}{\sqrt{ 2 }}}=\frac{\sqrt{ 2 }}{2}=\frac{1}{\sqrt{ 2 }}=\sin\left( \frac{\pi}{4} \right)
C=0
By plugging in C=0 in the general solution we get the solution to the IVP, as stated earlier, there can only be one solution to a linear IVP DE: