class: center, middle, inverse, title-slide .title[ # Non-homogeneus Linear ODEs ] .subtitle[ ## Session 02 ] .author[ ### Alejandro Ucan ] .date[ ### 2023-09-17 ] ---
# Session's Goals * Learn the generic form of a linear ODE <br/><br/> * Learn how to solve linear ODEs <br/><br/> * Learn the method of variation of parameters <br/><br/> --- # Linear ODE. > The generic form of a linear ODE is `$$a_1(x)y'+a_0(x)y+g(x)=0,$$` where `\(a_0(x)\)` and `\(a_1(x)\)` are the coefficients. <br/><br/> If `\(g(x)=0,\)` then the ODE is said to be __homogeneous__, otherwise it is __non-homogeneous.__ -- ##### Example: Homogeneuos: `\(y'-2xy-2=0,\, xy'-4y-x^6e^x=0.\)` <br/><br/> Non-homogeneuos: `\(y'-2xy-2=1,\, xy'-4y-x^6e^x=1.\)` --- ## How to solve those ODEs? > Put the ODE in form `$$y'+P(x)y=f(x).$$` Our solutions have to be in an interval `\(I\)` where `\(P(x)\)` and `\(f(x)\)` are continuous functions. <br/><br/> The solution is given by `$$y(x)=y_h(x)+y_p(x),$$` where `\(y_h\)` is a solution to the homogeneous version of the ODE and `\(y_p\)` is a particular solution of the ODE. --- ## Method: Integrating Factor > We need to find a solution of the form `\(y_p=u(x)y_1(x)\)` where `\(y_1\)` is a solution of the homogeneous version of the ODE. <br/><br/> Método: 1. Escribir la EDO de la forma: `$$y'+P(x)y=f(x).$$` 1. The coefficient function `\(P(x)\)` will help us to compute our __integrating factor__ `$$e^{\int P(x)dx}.$$` 1. If we multiply our ODE by the integrating factor, we obtain `$$\frac{d}{dx}\left[e^{\int P(x)dx} y\right]= e^{\int P(x)dx}f(x).$$` 1. Integrate in both sides and solve for `\(y.\)` --- ### Example 1 > Solve `\(4y'-3y=4.\)` 1. Putting the ODE in the form `\(y'+P(x)y=f(x)\)` we have `\(y'-\frac{3}{4}y=1.\)` 1. `\(P(x)=-\frac{3}{4},\)` therefore the integrating factor `$$e^{\int \frac{-3}{4}dx}=e^{\frac{-3}{4}x}.$$` 1. We multiply our ODE by the integrating factor and we obtain `$$\frac{d}{dx}\left[e^{\frac{-3}{4}x}y\right]=e^{\frac{-3}{4}x}.$$` 1. We integrate and solve for `\(y.\)` `$$e^{\frac{-3}{4}x}y=c\Rightarrow y=ce^{\frac{3}{4}x}.$$` Integramos y despejamos: `$$e^{-3x}y=c\Rightarrow y=c e^{3x}.$$` --- ### Example 2 > Solve `\(y'-2y=6.\)` 1. It is already in its standard form. 1. `\(P(x)=-2,\)` therefore the integrating factor is `$$e^{\int -2dx}=e^{-2x}.$$` 1. We multiply our ODE by the integrating factor and we obtain `$$\frac{d}{dx}\left[e^{-2x}y\right]=6e^{-2x}.$$` 1. We integrate both sides and solve for `\(y\)`: `$$e^{-2x}y=-3e^{-2x}+c\Rightarrow y=-3+ce^{-2x}.$$` --- ### Ejemplo 3 > Resuelva la ecuación `\(y'-2xy=2x.\)` --- # Non-free Falling Body > Consider a falling body but the medium where it falls presents a resistance (let's say the air). If the velocity with which the body falls is given by `\(v(t)\)` then it satisfies the non-homogeneous linear ODE: `$$mv'+\beta v=mg,$$` where `\(m\)` is the mass of the object, `\(\beta\)` is the resistance constant, and `\(g\)` is the gravity force. --- ## Lets solve it! Using __integrating factor__ we can solve this ODE, let's see: 1. `\(P(x)=\beta/m,\)` `\(f(x)=g\)` y the integrating factor: `$$e^{\frac{\beta t}{m}}.$$` 1. Multiplying the integrating factor and transform the equation `$$\frac{d}{dt}\left[e^{\frac{\beta t}{m}}v\right]=ge^{\frac{\beta t}{m}}.$$` 1. Integrating both sides and solve for `\(v\)`: `$$v(t)=\frac{mg}{\beta}+ce^{-\frac{\beta t}{m}}.$$`