# Efficient way to solve a complicated system of linear equations

I want to find the solution of a system of linear equations, that seems a bit too complex to do by hand. I've tried some online tools like symbolab but they've failed me.

Does anyone know an efficient way to solve the system below? Maybe some tool/computer program exists for such?

I want to solve for $v_x,v_y,v_z$. Everything else is given.

$$\begin{cases} a_{11}v_x+a_{21}v_y+a_{31}v_z+a_{41}=p_x(a_{14}v_x+a_{24}v_y+a_{34}v_z+a_{44}) \\ a_{12}v_x+a_{22}v_y+a_{32}v_z+a_{42}=p_y(a_{14}v_x+a_{24}v_y+a_{34}v_z+a_{44}) \\ a_{13}v_x+a_{23}v_y+a_{33}v_z+a_{43}=p_z(a_{14}v_x+a_{24}v_y+a_{34}v_z+a_{44}) \end{cases}$$

• You can distribute and group the terms, write the system as matrices and use Gauss-Jordan elimination. – Alex D Apr 28 '18 at 1:43

$$= \begin{cases} a_{11}v_x - p_x a_{14}v_x + a_{21}v_y - p_x a_{24}v_y +a_{31}v_z - p_x a_{34}v_z = p_x a_{44} - a_{41} \\ a_{12}v_x - p_y a_{14}v_x + a_{22}v_y - p_y a_{24}v_y +a_{32}v_z - p_y a_{34}v_z = p_y a_{44} - a_{42} \\ a_{13}v_x - p_z a_{14}v_x + a_{23}v_y - p_z a_{24}v_y+ a_{33}v_z - p_z a_{34}v_z = p_z a_{44} - a_{43} \end{cases}$$

$$= \begin{cases} (a_{11} - p_x a_{14})v_x + (a_{21} - p_x a_{24})v_y + (a_{31} - p_x a_{34})v_z = p_x a_{44} - a_{41} \\ (a_{12} - p_y a_{14})v_x + (a_{22} - p_y a_{24})v_y + (a_{32} - p_y a_{34})v_z = p_y a_{44} - a_{42} \\ (a_{13} - p_z a_{14})v_x + (a_{23} - p_z a_{24})v_y + (a_{33} - p_z a_{34})v_z = p_z a_{44} - a_{43} \end{cases}$$

$$= \begin{cases} v_x + \frac{a_{21} - p_x a_{24}}{a_{11} - p_x a_{14}}v_y + \frac{a_{31} - p_x a_{34}}{a_{11} - p_x a_{14}}v_z = \frac{p_x a_{44} - a_{41}}{a_{11} - p_x a_{14}} \\ v_y + \frac{(a_{32} - p_y a_{34} - (a_{12} - p_y a_{14})\frac{a_{31} - p_x a_{34}}{a_{11} - p_x a_{14}})}{(a_{22} - p_y a_{24} - (a_{12} - p_y a_{14})\frac{a_{21} - p_x a_{24}}{a_{11} - p_x a_{14}})}v_z = \frac{p_y a_{44} - a_{42} - (a_{12} - p_y a_{14})\frac{p_x a_{44} - a_{41}}{a_{11} - p_x a_{14}}}{(a_{22} - p_y a_{24} - (a_{12} - p_y a_{14})\frac{a_{21} - p_x a_{24}}{a_{11} - p_x a_{14}})} \\ v_y + \frac{(a_{33} - p_z a_{34} - (a_{13} - p_z a_{14})\frac{a_{31} - p_x a_{34}}{a_{11} - p_x a_{14}})}{(a_{23} - p_z a_{24} - (a_{13} - p_z a_{14})\frac{a_{21} - p_x a_{24}}{a_{11} - p_x a_{14}})}v_z = \frac{p_z a_{44} - a_{43} - (a_{13} - p_z a_{14})\frac{p_x a_{44} - a_{41}}{a_{11} - p_x a_{14}}}{(a_{23} - p_z a_{24} - (a_{13} - p_z a_{14})\frac{a_{21} - p_x a_{24}}{a_{11} - p_x a_{14}})} \end{cases}$$

$$= \begin{cases} v_x = \frac{p_x a_{44} - a_{41}}{a_{11} - p_x a_{14}} - \frac{a_{21} - p_x a_{24}}{a_{11} - p_x a_{14}}v_y - \frac{a_{31} - p_x a_{34}}{a_{11} - p_x a_{14}}v_z \\ v_y = \frac{p_y a_{44} - a_{42} - (a_{12} - p_y a_{14})\frac{p_x a_{44} - a_{41}}{a_{11} - p_x a_{14}}}{(a_{22} - p_y a_{24} - (a_{12} - p_y a_{14})\frac{a_{21} - p_x a_{24}}{a_{11} - p_x a_{14}})} - \frac{(a_{32} - p_y a_{34} - (a_{12} - p_y a_{14})\frac{a_{31} - p_x a_{34}}{a_{11} - p_x a_{14}})}{(a_{22} - p_y a_{24} - (a_{12} - p_y a_{14})\frac{a_{21} - p_x a_{24}}{a_{11} - p_x a_{14}})}v_z \\ v_z = \frac{\frac{p_z a_{44} - a_{43} - (a_{13} - p_z a_{14})\frac{p_x a_{44} - a_{41}}{a_{11} - p_x a_{14}}}{(a_{23} - p_z a_{24} - (a_{13} - p_z a_{14})\frac{a_{21} - p_x a_{24}}{a_{11} - p_x a_{14}})} - \frac{p_y a_{44} - a_{42} - (a_{12} - p_y a_{14})\frac{p_x a_{44} - a_{41}}{a_{11} - p_x a_{14}}}{(a_{22} - p_y a_{24} - (a_{12} - p_y a_{14})\frac{a_{21} - p_x a_{24}}{a_{11} - p_x a_{14}})}}{ \frac{(a_{33} - p_z a_{34} - (a_{13} - p_z a_{14})\frac{a_{31} - p_x a_{34}}{a_{11} - p_x a_{14}})}{(a_{23} - p_z a_{24} - (a_{13} - p_z a_{14})\frac{a_{21} - p_x a_{24}}{a_{11} - p_x a_{14}})} - \frac{(a_{32} - p_y a_{34} - (a_{12} - p_y a_{14})\frac{a_{31} - p_x a_{34}}{a_{11} - p_x a_{14}})}{(a_{22} - p_y a_{24} - (a_{12} - p_y a_{14})\frac{a_{21} - p_x a_{24}}{a_{11} - p_x a_{14}})} } \end{cases}$$

$$= \begin{cases} v_x = \frac{p_x a_{44} - a_{41}}{a_{11} - p_x a_{14}} - \frac{a_{21} - p_x a_{24}}{a_{11} - p_x a_{14}}\left( \frac{p_y a_{44} - a_{42} - (a_{12} - p_y a_{14})\frac{p_x a_{44} - a_{41}}{a_{11} - p_x a_{14}}}{(a_{22} - p_y a_{24} - (a_{12} - p_y a_{14})\frac{a_{21} - p_x a_{24}}{a_{11} - p_x a_{14}})} - \frac{(a_{32} - p_y a_{34} - (a_{12} - p_y a_{14})\frac{a_{31} - p_x a_{34}}{a_{11} - p_x a_{14}})}{(a_{22} - p_y a_{24} - (a_{12} - p_y a_{14})\frac{a_{21} - p_x a_{24}}{a_{11} - p_x a_{14}})} \cdot \frac{\frac{p_z a_{44} - a_{43} - (a_{13} - p_z a_{14})\frac{p_x a_{44} - a_{41}}{a_{11} - p_x a_{14}}}{(a_{23} - p_z a_{24} - (a_{13} - p_z a_{14})\frac{a_{21} - p_x a_{24}}{a_{11} - p_x a_{14}})} - \frac{p_y a_{44} - a_{42} - (a_{12} - p_y a_{14})\frac{p_x a_{44} - a_{41}}{a_{11} - p_x a_{14}}}{(a_{22} - p_y a_{24} - (a_{12} - p_y a_{14})\frac{a_{21} - p_x a_{24}}{a_{11} - p_x a_{14}})}}{ \frac{(a_{33} - p_z a_{34} - (a_{13} - p_z a_{14})\frac{a_{31} - p_x a_{34}}{a_{11} - p_x a_{14}})}{(a_{23} - p_z a_{24} - (a_{13} - p_z a_{14})\frac{a_{21} - p_x a_{24}}{a_{11} - p_x a_{14}})} - \frac{(a_{32} - p_y a_{34} - (a_{12} - p_y a_{14})\frac{a_{31} - p_x a_{34}}{a_{11} - p_x a_{14}})}{(a_{22} - p_y a_{24} - (a_{12} - p_y a_{14})\frac{a_{21} - p_x a_{24}}{a_{11} - p_x a_{14}})} } \right) - \frac{a_{31} - p_x a_{34}}{a_{11} - p_x a_{14}} \cdot \frac{\frac{p_z a_{44} - a_{43} - (a_{13} - p_z a_{14})\frac{p_x a_{44} - a_{41}}{a_{11} - p_x a_{14}}}{(a_{23} - p_z a_{24} - (a_{13} - p_z a_{14})\frac{a_{21} - p_x a_{24}}{a_{11} - p_x a_{14}})} - \frac{p_y a_{44} - a_{42} - (a_{12} - p_y a_{14})\frac{p_x a_{44} - a_{41}}{a_{11} - p_x a_{14}}}{(a_{22} - p_y a_{24} - (a_{12} - p_y a_{14})\frac{a_{21} - p_x a_{24}}{a_{11} - p_x a_{14}})}}{ \frac{(a_{33} - p_z a_{34} - (a_{13} - p_z a_{14})\frac{a_{31} - p_x a_{34}}{a_{11} - p_x a_{14}})}{(a_{23} - p_z a_{24} - (a_{13} - p_z a_{14})\frac{a_{21} - p_x a_{24}}{a_{11} - p_x a_{14}})} - \frac{(a_{32} - p_y a_{34} - (a_{12} - p_y a_{14})\frac{a_{31} - p_x a_{34}}{a_{11} - p_x a_{14}})}{(a_{22} - p_y a_{24} - (a_{12} - p_y a_{14})\frac{a_{21} - p_x a_{24}}{a_{11} - p_x a_{14}})} } \\ v_y = \frac{p_y a_{44} - a_{42} - (a_{12} - p_y a_{14})\frac{p_x a_{44} - a_{41}}{a_{11} - p_x a_{14}}}{(a_{22} - p_y a_{24} - (a_{12} - p_y a_{14})\frac{a_{21} - p_x a_{24}}{a_{11} - p_x a_{14}})} - \frac{(a_{32} - p_y a_{34} - (a_{12} - p_y a_{14})\frac{a_{31} - p_x a_{34}}{a_{11} - p_x a_{14}})}{(a_{22} - p_y a_{24} - (a_{12} - p_y a_{14})\frac{a_{21} - p_x a_{24}}{a_{11} - p_x a_{14}})} \cdot \frac{\frac{p_z a_{44} - a_{43} - (a_{13} - p_z a_{14})\frac{p_x a_{44} - a_{41}}{a_{11} - p_x a_{14}}}{(a_{23} - p_z a_{24} - (a_{13} - p_z a_{14})\frac{a_{21} - p_x a_{24}}{a_{11} - p_x a_{14}})} - \frac{p_y a_{44} - a_{42} - (a_{12} - p_y a_{14})\frac{p_x a_{44} - a_{41}}{a_{11} - p_x a_{14}}}{(a_{22} - p_y a_{24} - (a_{12} - p_y a_{14})\frac{a_{21} - p_x a_{24}}{a_{11} - p_x a_{14}})}}{ \frac{(a_{33} - p_z a_{34} - (a_{13} - p_z a_{14})\frac{a_{31} - p_x a_{34}}{a_{11} - p_x a_{14}})}{(a_{23} - p_z a_{24} - (a_{13} - p_z a_{14})\frac{a_{21} - p_x a_{24}}{a_{11} - p_x a_{14}})} - \frac{(a_{32} - p_y a_{34} - (a_{12} - p_y a_{14})\frac{a_{31} - p_x a_{34}}{a_{11} - p_x a_{14}})}{(a_{22} - p_y a_{24} - (a_{12} - p_y a_{14})\frac{a_{21} - p_x a_{24}}{a_{11} - p_x a_{14}})} } \\ v_z = \frac{\frac{p_z a_{44} - a_{43} - (a_{13} - p_z a_{14})\frac{p_x a_{44} - a_{41}}{a_{11} - p_x a_{14}}}{(a_{23} - p_z a_{24} - (a_{13} - p_z a_{14})\frac{a_{21} - p_x a_{24}}{a_{11} - p_x a_{14}})} - \frac{p_y a_{44} - a_{42} - (a_{12} - p_y a_{14})\frac{p_x a_{44} - a_{41}}{a_{11} - p_x a_{14}}}{(a_{22} - p_y a_{24} - (a_{12} - p_y a_{14})\frac{a_{21} - p_x a_{24}}{a_{11} - p_x a_{14}})}}{ \frac{(a_{33} - p_z a_{34} - (a_{13} - p_z a_{14})\frac{a_{31} - p_x a_{34}}{a_{11} - p_x a_{14}})}{(a_{23} - p_z a_{24} - (a_{13} - p_z a_{14})\frac{a_{21} - p_x a_{24}}{a_{11} - p_x a_{14}})} - \frac{(a_{32} - p_y a_{34} - (a_{12} - p_y a_{14})\frac{a_{31} - p_x a_{34}}{a_{11} - p_x a_{14}})}{(a_{22} - p_y a_{24} - (a_{12} - p_y a_{14})\frac{a_{21} - p_x a_{24}}{a_{11} - p_x a_{14}})} } \end{cases}$$

Hope that helps. The explicit solution (last system) is a bit unwieldy. You might find it easier to use the system just before it and do the backsubstitution with the values rather than the full expressions. I.e., calculate the value of $v_z$, then use that where it appears in $v_y$ , then use those where they appear in $v_x$.

• Thank you very much! This helps a lot. May ask how you managed to come up with the solution? Or did you just do it all by hand :O? – BroccoliFinancials Apr 28 '18 at 2:49
• @BroccoliFinancials : I did it by hand, in the MSE editor, since Gaussian elimination is largely a cut-and-paste operation. – Eric Towers Apr 28 '18 at 2:52