Solving Ax + Bx = b (same matrix in two equations)

63 Views Asked by At

I have a differential equation:

$y''(x) + \frac{1}{2}y'(x) = cos(x)$

$y''(x) = \frac{1}{h^2}A$y

$y'(x) = \frac{1}{2h}B$y

How do you solve for y ? I've only seen equations of the form Ax=b before, but this one seems like y is dependent in two equations. I know A and B. I believe that b would be cos(x).

Note for transparency: This is a MatLab homework assignment, but I'm confused about the actual math involved, so I've changed the actual equation slightly and omitted anything that would be for marks - tried to make it as conceptual as possible.

1

There are 1 best solutions below

1
On

$$y''(x) = \frac{1}{h^2}Ay$$ We know from equation 1 that $$y''(x) + \frac{1}{2}y'(x) = cos(x) \implies y''(x) =- \frac{1}{2}y'(x) + cos(x)$$ $$ -\frac{1}{2}y'(x) + cos(x)= \frac{1}{h^2}Ay$$ From third equation we know that $$y'(x) = \frac{1}{2h}By$$ $$ -\frac{1}{2}\frac{1}{2h}By + \cos(x)= \frac{1}{h^2}Ay$$ Rearrange terms $$ \frac{1}{h^2}Ay +\frac{1}{4h}By=\cos(x)$$ $$ (\frac{1}{h^2}A +\frac{1}{4h}B)y=\cos(x)$$ Which is of the form $Ax=b$ you already know $$Cy=\cos(x)$$

Of course you can solve the first differential equation directly too to get $y(x)$