What is the solution to the differential equation d𝑦 by d𝑥 equals cos two 𝑥 over 𝑒 to the power of two 𝑦, where 𝑦 of 𝜋 by eight is equal to zero?
This is a first-order differential equation because it involves a first-order derivative d𝑦 by d𝑥. And it is, in fact, a separable differential equation. We see that by rearranging the equation, we can separate the 𝑦-index variables on two different sides. We can multiply by 𝑒 to the power of two 𝑦 to eliminate the denominator on the right-hand side. And remember d𝑦 by d𝑥 is not a fraction, but we can treat it a little one. So multiplying by d𝑥 as well, we have 𝑒 the power of two 𝑦 d𝑦 equals cos two 𝑥 d𝑥. We’ve now separated the variables because we have all of the 𝑦s on the left-hand side and all of the 𝑥s on the right-hand side.
To solve this differential equation, we’re going to need to find its antiderivative. So we need to integrate both sides of the equation. We have that the integral of 𝑒 to the power of two 𝑦 with respect to 𝑦 is equal to the integral of cos two 𝑥 with respect to 𝑥. We recall first of all the derivatives of exponential functions. The derivative with respect to 𝑥 of 𝑒 to the power of 𝑎𝑥, where 𝑎 is some constant is 𝑎𝑒 to the power of 𝑎𝑥. So working in reverse, we see that the antiderivative of 𝑒 to the power of two 𝑦 with respect to 𝑦 is one-half 𝑒 to the power of two 𝑦. Instead of multiplying by the constant two, we have divided by it so that when we differentiate one-half 𝑒 to the power two 𝑦, we get back to 𝑒 to the power of two 𝑦.
Now notice that I haven’t included a constant of integration here and I’ll talk more about that in a moment. On the right-hand side, we recall a standard result for differentiation of trigonometric functions, where the angle is measured in radians. The derivative with respect to 𝑥 of sin 𝑎𝑥 where 𝑎 is a constant is 𝑎 cos 𝑎𝑥. So it follows that the antiderivative of cos two 𝑥 will be one-half multiplied by sin two 𝑥. We divide by that factor of two because we are integrating rather than differentiating.
This time, I will include a constant of integration 𝑐. And now, we’ll discuss why I didn’t include one on the left-hand side. Suppose I had done. So, I’d included a constant of integration 𝑐 one on the left-hand side and a different constant of integration 𝑐 two on the right-hand side. We could then subtract our constant 𝑐 one from each side of the equation, giving one-half 𝑒 to the two 𝑦 equals one-half sin two 𝑥 plus 𝑐 two minus 𝑐 one. But 𝑐 two minus 𝑐 one is just another constant of integration, which we could call 𝑐. This gives the same as what I’d written originally. So for this reason, we don’t need to include constant of integration on both sides of our integral.
Now we do want to simplify this equation a little. And what we’d like to do is make 𝑦 the subject. So the first step is going to be to multiply everything in the equation through by two because we have that factor of one-half. Doing so gives 𝑒 to the power of two 𝑦 equals sin two 𝑥 plus two 𝑐. But two 𝑐 is just a different constant of integration. So we can replace it instead with capital 𝐶. Now we could continue with our rearrangement of this equation to make 𝑦 the subject. But actually it’s probably easiest to pause at this point and use the boundary condition we’ve been given — that’s 𝑦 of 𝜋 by eight equals zero — to determine the value of our constant of integration 𝐶. Substituting 𝜋 by eight for 𝑥 and zero for 𝑦 gives 𝑒 to the power of two times zero equals sin of two times 𝜋 by eight plus 𝐶. Two times zero is just zero and 𝑒 to the power of zero is one. So we have that one equals sin of 𝜋 by four plus 𝐶.
Now 𝜋 by four is one of those special angles for which we should know the values of its trigonometric ratios sine, cosine, and tangent off by heart because they can be expressed exactly in terms of surds. Sin of 𝜋 by four is equal to root two over two. So substituting this value gives one equals root two over two plus 𝐶. Finally, for this stage, by subtracting root two over two from each side of our equation, we find that the value of our constant of integration 𝐶 is one minus root two over two. We can now substitute the value we’ve calculated for 𝐶 back into our solution to the differential equation, making it a particular rather than general solution, and continue with our rearrangement.
We can take the natural logarithm of each side, leaving just two 𝑦 on the left-hand side and the natural logarithm of sin two 𝑥 plus one minus root two over two on the right-hand side. Finally, we divide by two to leave just 𝑦 on its own on the left- side, giving 𝑦 equals one-half the natural logarithm of sin two 𝑥 plus one minus root two over two. We can write those terms inside the natural logarithm in any order we choose.
So we’ll give our final answer. The solution to this differential equation with the given boundary condition as 𝑦 equals one-half the natural logarithm of sin two 𝑥 minus root two over two plus one.