 Hi, I'm Zor. Welcome to Unisor Education. Today I would like to continue talking about different types of ordinary differential equations. In this case it's about linear differential equations. So there are three types which I will cover including this lecture of ordinary differential equations. One is separable when you can separate y from x into different parts of the equation and basically integrate it left and right separately. Then the second was homogeneous. That's where basically everything depends on the ratio x divided by y or y divided by x. And we substitute function y as a product of z times x where z is another function. And the third is linear equation. That's my third lecture in this series. Which I would just repeat the general approach to solving these equations. And I will consider three different examples. This lecture is part of the course of advanced mathematics for teenagers presented on Unisor.com. It's probably better if you watch this lecture from the website. You just go to the front menu. It's maths for teens, calculus. And then you have ordinary differential equations and different types of equations. The site is free. It does not have any advertisement. So you don't even have to sign in. But if you do you can take exams for instance. Well actually you can take exams even without signing on. But it will not be remembered by the system. So in any case, let me just proceed with linear equations. First of all let me just repeat something which I did already once. When I was presenting just a general view of ordinary differential equations. So that's a repetition. That's a very healthy and needed one. So what is linear differential equations and how to deal with it? Linear is something like this. Y is a function of x. So this is derivative. This is the function itself. And f, g and h are different functions of s. Now why is it called linear? Well obviously because y and y derivative are linearly involved in this particular equation. Now how to solve it? Again that was addressed before but I'm just repeating. Well first of all we do consider the function f at x is not identically equal to 0. Because otherwise it's not a differential equation. So wherever it's not equal to 0 we just divide everything and we will have another function. Another equation. Where u function is basically g of x divided by f at x. And v is h divided by f. So that's a simplification which leads to a little bit simpler representation of our equation. Now next and here is the key to the solution basically. We are trying to find a solution of this particular equation in a specific form. As a product of two functions. And then I will basically determine each one of these functions. Now if I represent it this way then the derivative is equal to... That's a product of two functions. So derivative of the product. Derivative of the first times second plus derivative of second times first. So this is something which we can substitute into this equation to get the following. So instead of y derivative we put this. Then we have u times y. Which is u times p times q. y is p times q. And v equals to 0. I'm not writing of x all of these are functions of x. So it's just simpler for me. Now this equation although it looks a little bit more complex than this. Can actually be represented the following way. Let me just combine these two. And take p outside of the parenthesis having q derivative plus u q. And whatever is left would be the second component. What I'm going to do is I'm going to find such a function q which puts this to 0. And once I found this function q I can substitute it here. Then it will be a known function. And resolve this equation for p which is easy. So this is easy to resolve for q. I'll show you how. It's a simple separation. And this is even simpler for p. And that's how I will find p and q. And their product would be my function y, right? So the q from here is dq by dx. That's what derivative is. Plus u times q is equal to 0. Which means dq divided by q equals to minus u dx. Am I right? u q goes here. q goes down. dx goes up. And the minus sign. Yes. Now I can separately integrate these functions, right? U is a known function of x. So I can integrate it whatever it is. And this also can be integrated. This is a logarithm of absolute value of q. So it's equal to this integral. From which I derive q is equal to, well, it's actually a plus or minus q, but it doesn't really matter much. So it would be e to the power minus integral u dx. So anyway, somehow q is defined. Whether it's a plus q or minus q doesn't really matter. We have to find just one particular function, q. It doesn't matter which one. I don't even have to put the constant there. Like plus c or something like this. Any q will work as long as this is equal to 0. And then from here I will determine p. Now how to determine p if q is known? Well, that's even simpler. Because now if I know the q and pq plus v is equal to 0, then derivative of p is equal to minus v divided by q. So what I have to do is just integrate these two things and get the p. Well, basically that's it. That's the approach. Now I'm going to do a couple of examples. Well, three examples. It's more than a couple. And see this methodology applied in practice. Okay, my first example is y derivative plus y plus x is equal to 0. Okay, so let's represent y is equal to p times q. y derivative is equal to p derivative q plus p times q derivative. So my equation becomes p derivative q plus pq derivative. That's y derivative plus y which is pq plus x is equal to 0, right? I combined the middle part will be p times q derivative plus q plus p derivative q plus x is equal to 0, all right? pq times x. Okay, so let's first find out what brings this to 0, right? dq by d by q by q, not by x, equals minus dx, all right? This is dq by dx. So q goes here, dx goes there. Now I can integrate both parts, getting logarithm absolute value of q. Well, again, I don't really need absolute value because I need just one particular solution. It's equal to minus x, right? So q is equal to e to the power of minus x. Okay, now let's find p from equating this to 0. So let me put q is equal to e to the power of minus x. Just in case, let me check. e to the power of minus x, if I differentiate it, it will be e to the power of minus x times derivative of minus x, which is minus 1. So it's minus e to the power of minus x. And plus q, which is e to the power of minus x, that's 0. So that's fine. So now let's solve the second part for p. So p derivative q plus x is equal to 0. p is equal to minus x divided by e to the power of minus x, which is equal to minus x times e to the power of x, right? 1 over e to the power of minus x is just e to the power of x. Now I have to integrate it. So p of x is equal to integral of minus x e to the power of x dx. Let me put minus in front of it. Makes my life easier. Now this is a typical integration by parts, right? So it's equal to minus. So we have u and e to the power of x and dx is basically dv. It's u, x is u, and since derivative of e to the power of x is e to the power of x, so differential of e to the power of x is whatever it is. So it's u times v, which is x times e to the power of x minus e to the power of x times dx, integral of this, and this is equal to obviously e to the power of x. So I have this minus and this minus will be plus, so it will be p is equal to 2. So this is just e to the power of x. So e to the power of x can be outside the parentheses and in the parentheses I will have 1 minus x. Now where should I put the constant? Well, probably here, right? So e to the power of x, which is this. Now this is minus x e to the power of x, okay? And plus c. Plus c goes here. Now y as a product of these two. So I will have to multiply this time this, so it's 1 minus x plus c times e to the power of minus x. That's my answer. Now it would be nice to check it, basically substitute to this. I actually did it in the notes for these lectures, which are available at Unisor.com, and I have my answer here, it corresponds, so it checks. But I do recommend you to check it yourself. Whenever you do some kind of a solution of this type, always check if it satisfies your equation. So that's the answer. Let's move on. Next. Okay. So this is, again, a linear differential equation. And the only thing is, it has this function cos of x with derivative of y. And we have agreed that first thing which we do, we divide by this function to have y derivative by itself. So we divide everything by cos. So I have y times sin divided by cos. That's a tangent, right? Minus 1 over cos, which is actually second of x. Equals to 0. Actually, let's just write it as 1 over cos. It would be a little bit more understandable for me. Okay. So that's our equation. Let's do exactly the same as usual. y is equal to p times q. y derivative is p derivative q plus p times q derivative. Our equation looks like p derivative q plus pq derivative. That's y derivative. Plus p times q times tangent of x. And minus 1 over cos of x. Equals to 0. These are two members which I can combine. And so it's p times q derivative plus q tangent of x. Plus p derivative q minus 1 over cos of x equals to 0. Okay. So first we will find some q which turns this into 0. Okay. Fine. So let's do that. So dq by dx equals minus q tangent x, right? So dq divided by q goes tangent times dx, right? Well, actually what would be even better is instead of tangent, I will put sin of x divided by cos sin of x. You know why? Because derivative of the cosine is minus sin. So I can actually have this as d cosine x divided by cosine x, right? Differential of cosine is derivative of cosine which is minus sin times dx. And now I have a very easy integral. From the left I will have logarithm. If I will integrate this, I will have logarithm q. But again, let's just not use absolute value. Because we need just one particular solution equals to logarithm of cosine of x, right? From which q is equal to cosine of x. We got that. Well, we can use plus c but it doesn't really matter because we need only one of them. Now, unfortunately I wiped out my equation so let me just write it down again. What was it? It was p star q plus pq star plus pq tangent of x minus 1 over cosine of x equals to 0. Now this I have taken care of. So I need to combine with this where q is this. So I have p times cosine of x that's pq equals to 1 over cosine of x. So I have p is equal to 1 over cosine square x. Now which function has a derivative 1 over cosine square? Is it tangent? Tangent x derivative. What is tangent derivative? Well, since I don't remember, I will derive it right now. But I think that's tangent. Derivative equals... So derivative of sine divided by cosine which is 1 plus sine and derivative of 1 over cosine which is minus 1 cosine square times minus minus sine of x. So that would be plus. So it's 1 plus sine square divided by cosine square of x. Cosine goes here would be 1 1 over cosine square. Correct. I do still remember something. So my function p from this is equal to tangent x plus some kind of a constant c. Alright. And q was what was the q? q was cosine, right? Yes, q was cosine. So pq which is y is equal to tangent times cosine. Tangent is sine over cosine times cosine would be sine of x. Plus c cosine x or c any constant. Again, you can check it and it corresponds to whatever my solution is. You did check it on Unicor on Unizor.com and I suggest you to do it yourself first. And always, whenever you are solving differential equations or any kind of equations, checking is a must, always. And the last problem I have... Okay, logarithm x times y derivative plus y equals logarithm 2x plus x square. Well, it doesn't look right. It doesn't look like a linear equation right now. But obviously if I have logarithm here and here and this is just a function, I can raise e to this power and I will get what? I will get x times y plus y on the left. e to the power of logarithm of something is something, right? Equals e to the power of this plus this. Whenever you are raising into power which is a sum of two, it's a product of powers, right? So it's e to the power of logarithm 2x which is 2x times e to the power of x square. So that's my final equation. Now, is it linear? Well, it's linear already, but it's not normalized because this is still a function at y derivative. So I will divide now by x and I will have this. Now, this is a linear equation. This is a function 1 over x. This is function 2e to the power x square. So this is a linear equation and I can attempt to solve it using the procedure which we did before. So again, y is equal to p times q. y derivative is equal to pq plus pq prime. Substituted here. So I will have p derivative q plus pq derivative plus 1x times pq. So it's pq divided by x minus 2e to the power of x square equals to zero, right? I just converted everything to the left. Now, this is combined with this. p is outside, so I'm looking for a solution q prime plus q over x equals to zero. So that would bring me to zero these two, okay? Okay, so let me try. So it's dq by dx equals minus q over x, right? From which follows q dx. From which follows that logarithm q equals minus logarithm x. Whenever I integrate these two, integral of one dq divided by q is logarithm q. Again, I ignore the absolute value and this is minus logarithm x for the same reason. And now I have to find q by raising e to these powers. So I will have q is equal to e to the power of minus logarithm x. That's minus one. So it goes to the top. So that's x to the power of minus one. That's what it is. Let me check just in case. q derivative is one over x square minus one over x square and this is plus one over x square. So it's correct. Now I will use it to combine this and this and try to find p derivative which bring this to zero. Okay, so q is equal to one over x and I don't need this because I'm not going to check it anyway. So my p derivative q minus two e to the power of x square equals. q is one over x. So I have this or I can put x on the right. Now I have to take integrals. Now two x dx. Now two x and dx is actually differential of x square, right? So that makes my life much easier. So this is just an integral of e to the power of t. Let's say t is x square which is e to the power of t plus constant. Which is e to the power of x square plus constant c. That's my p. So I've got p and I've got x. So p times x would be what? I is equal to p which is this times x which is divided by x. So e to the x square plus c divided by x. We'll see any constant. Again, it's good to make a checking. Checking is made on Unisor.com. My answer is correct. So everything is supposed to be checked. Now, why don't you just go to the website. Ignore all these calculations which I am actually putting in writing as the notes for this lecture. And just try to solve exactly the same three problems just by yourself with the checking. And that will be a good exercise in linear differential equations. That's it for today. Thank you very much and good luck.