Solve three equations for three unknowns.

303 Views Asked by At

So I have the following three equations which I do not know how to solve:

-D * x - E * y = A + (R * D)

E * F * x - D * F * y - G * z = B - (R * E * F)

E * G * x - D * G * y + F * z = C - (R * E * G)

What is the solution for this? How do I get the values of x, y and z. The rest are constants.

2

There are 2 best solutions below

0
On BEST ANSWER

You have three linear equations in three unknowns. There are a number of well known methods for doing that. Here, the first thing I notice is that there is no "z" in the first equation so it might be simplest to eliminate z from the other two. The second equation has "-Gz" and the third equation has "Fz".

Multiplying the second equation by F gives:

E * F^2 * x - D * F^2 * y - F*G * z = B*F - (R * E * F^2)."|

Multiplying the third equation by G gives:

E * G^2 * x - D * G^2* y + F *G* z = C*G - (R * E * G^2).

Now, add the two equations to eliminate z:

E*(F^2+ G^2)x- D*(F^2+ G^2)y=  B*F+ C*G- R*E*(F^2- G^2).  

That, together with the first equation, -D * x - E * y = A + (R * D), gives two equations in two unknowns, x and y, so our next objective would be to eliminate one of those.

Seeing the "E*(F^2+ G^2)" multiplying x in the equation above and "-D" in this one, I would multiply this equation by E*(F^2+ G^2) to get:

-D *E*(F^2+ G^2)*x - E^2*(F^2+ G^2)*y = A*E*(F^2+ G^2) + R * D* E*(F^2+ G^2)

and multiply the previous one by D to get:

D*E*(F^2+ G^2)x- D^2*(F^2+ G^2)y=  B*D*F+ C*D*G- R*D*E*(F^2- G^2).

Now adding those eliminates x leaving a single equation,

[-E^2*(F^2+ G^2)- D^2(F^2+ G^2)]y= -(E^2+ D^2)*(F^2+ G^2)y= A*E*(F^2+ G^2) + R * D* E*(F^2+ G^2)+ B*D*F+ C*D*G- R*D*E*(F^2- G^2) 

that is easily solved for y. Putting that value for y back into either of the equations involving only x and y gives an equation that can be solved for x and putting those value for x and y back into either of the equations that involved x, y, and z gives an equation to solve for z.

0
On

You've done a lot of the work already; recall that a system of linear equations can be represented as a coefficient matrix multiplied by a vector containing the variables of the problem. ($A\vec{x}=\vec{b}$)

Here, $\vec{b}$ represents the right side of all the equations, so

$\vec{b}=\begin{bmatrix}A + (R * D) \\ B - (R * E * F) \\ C - (R * E * G)\end{bmatrix}$

Matrix A represents the coefficients on the variables, so

$A=\begin{bmatrix}-D & -E & 0 \\ E*F & - D * F & - G \\ E * G & - D * G & F\end{bmatrix}$

$\vec{x}$ would be the variables of the equation, essentially factored out of their coefficients. It makes the math work, but we don't need to operate on it to solve the equation.

$\vec{x}=\begin{bmatrix}x\\y\\z\end{bmatrix}$

If you know the constants in the coefficient matrix, now would be the time to plug them in in the augmented matrix $[A|\vec{b}]=\begin{bmatrix} -D & -E & 0 & A+(R∗D) \\ E*F & - D * F & - G & B−(R∗E∗F)\\ E * G & - D * G & F & C−(R∗E∗G)\end{bmatrix}$ and convert it to reduced row echelon form. Alternatively, and mathematically the same operation, you can left-multiply $\vec{b}$ by $A^{-1}$ if you're able to obtain $A^{-1}$ more easily.

If a computational solution isn't an option, you'll make use of row operations (see this excellent post) to either (1) get $[A|\vec{b}]$ to row echelon form and solve by back substitution, or (2) get $[A|\vec{b}]$ to reduced row echelon form.