# Higher-Order Linear DE Problem!

#### Tom999

##### New member
y'' + (w^2)y = tan(qx)

w and q are constants. I can find the solution to the Homo DE but am not sure how to approach the Inhomogeneous Part.

#### MarkFL

##### Super Moderator
Staff member
Yes, the method of undetermined coefficients isn't going to work here. Are you familiar with the method of variation of parameters? I suspect that's just what we need here, but before we proceed, I want to be sure you have heard of this method.

#### Tom999

##### New member
Yes, I'm familiar with the method. I'm a bit frazzled by the execution though.

#### MarkFL

##### Super Moderator
Staff member
Yes, I'm familiar with the method. I'm a bit frazzled by the execution though.
Okay, good. First, we need the homogeneous solution...what do you have for that?

#### Tom999

##### New member
y = (C1)coswx + (C2)sinwx

#### MarkFL

##### Super Moderator
Staff member
Yes, we have:

$$\displaystyle y_h(x)=c_1\cos(wx)+c_2\sin(wx)$$

And so, we seek to find a particular solution of the form:

$$\displaystyle y_p(x)=v_1(x)\cos(wx)+v_2(x)\sin(wx)$$

So, we need to determine $$v_1(x)$$ and $$v_2(x)$$, by solving the following system and integrating:

$$\displaystyle \cos(wx)v_1'+\sin(wx)v_2'=0$$

$$\displaystyle -w\sin(wx)v_1'+w\cos(wx)v_2'=\tan(wx)$$

Can you solve the above system for $$v_1'$$ and $$v_2'$$?

Last edited:

#### Tom999

##### New member
I'm not sure how to proceed from there.

#### MarkFL

##### Super Moderator
Staff member
The first equation implies:

$$\displaystyle v_1'=-\tan(wx)v_2'$$

And then substituting for $$v_1'$$ into the second equation we get:

$$\displaystyle w\sin(wx)\tan(wx)v_2'+w\cos(wx)v_2'=\tan(wx)$$

Multiply through by $$\cos(wx)$$ to get:

$$\displaystyle w\sin^2(wx)v_2'+w\cos^2(wx)v_2'=\sin(wx)$$

Apply a Pythagorean identity to the LHS, divided through by $$w$$, and we have:

$$\displaystyle v_2'=\frac{1}{w}\sin(wx)\implies v_2(x)=-\frac{1}{w^2}\cos(wx)$$

And so:

$$\displaystyle v_1'=-\frac{1}{w}\sin(wx)\tan(wx)$$

Can you now find $$v_1(x)$$ by integrating?

#### Tom999

##### New member
Yes, I can do that from there. Thank you!

#### MarkFL

##### Super Moderator
Staff member
Yes, I can do that from there. Thank you!
Just so you can check your result, I would write:

$$\displaystyle v_1(x)=-\frac{1}{w^2}\int \sin(wx)\tan(wx)w\,dx=\frac{1}{w^2}\int \cos(wx)-\sec(wx)w\,dx=\frac{\sin(wx)-\ln(\sec(wx)+\tan(wx))}{w^2}$$

And so our particular solution is:

$$\displaystyle y_p(x)=\left(\frac{\sin(wx)-\ln(\sec(wx)+\tan(wx))}{w^2}\right)\cos(wx)+\left(-\frac{1}{w^2}\cos(wx)\right)\sin(wx)=-\frac{1}{w^2}\cos(wx)\ln(\sec(wx)+\tan(wx))$$

And so, the general solution to the given ODE is:

$$\displaystyle y(x)=y_h(x)+y_p(x)=c_1\cos(wx)+c_2\sin(wx)-\frac{1}{w^2}\cos(wx)\ln(\sec(wx)+\tan(wx))$$

And that would be our solution if I hadn't made a silly oversight...we have $$g(x)=\tan(qx)$$...and so we need to go all the way back to this system:

$$\displaystyle \cos(wx)v_1'+\sin(wx)v_2'=0$$

$$\displaystyle -w\sin(wx)v_1'+w\cos(wx)v_2'=\tan(qx)$$

As before, the first equation implies:

$$\displaystyle v_1'=-\tan(wx)v_2'$$

And so the second equation becomes:

$$\displaystyle -w\sin(wx)\left(-\tan(wx)v_2'\right)+w\cos(wx)v_2'=\tan(qx)$$

$$\displaystyle w\sin^2(wx)v_2'+w\cos^2(wx)v_2'=\tan(qx)\cos(wx)$$

$$\displaystyle v_2'=\frac{1}{w}\tan(qx)\cos(wx)$$

And I have no idea how to integrate that...W|A indicates that it involves the hypergeometric function.