Skip to main content
Solve for x, y
Tick mark Image
Graph

Similar Problems from Web Search

Share

ax-by+4b=-a
Consider the first equation. Subtract a from both sides. Anything subtracted from zero gives its negation.
ax-by=-a-4b
Subtract 4b from both sides.
2bx+2ay+b-4a=0
Consider the second equation. Use the distributive property to multiply 2 by bx+ay.
2bx+2ay-4a=-b
Subtract b from both sides. Anything subtracted from zero gives its negation.
2bx+2ay=-b+4a
Add 4a to both sides.
ax+\left(-b\right)y=-a-4b,2bx+2ay=4a-b
To solve a pair of equations using substitution, first solve one of the equations for one of the variables. Then substitute the result for that variable in the other equation.
ax+\left(-b\right)y=-a-4b
Choose one of the equations and solve it for x by isolating x on the left hand side of the equal sign.
ax=by-a-4b
Add by to both sides of the equation.
x=\frac{1}{a}\left(by-a-4b\right)
Divide both sides by a.
x=\frac{b}{a}y-\frac{4b}{a}-1
Multiply \frac{1}{a} times by-a-4b.
2b\left(\frac{b}{a}y-\frac{4b}{a}-1\right)+2ay=4a-b
Substitute \frac{-4b+by-a}{a} for x in the other equation, 2bx+2ay=4a-b.
\frac{2b^{2}}{a}y-\frac{8b^{2}}{a}-2b+2ay=4a-b
Multiply 2b times \frac{-4b+by-a}{a}.
\frac{2\left(a^{2}+b^{2}\right)}{a}y-\frac{8b^{2}}{a}-2b=4a-b
Add \frac{2b^{2}y}{a} to 2ay.
\frac{2\left(a^{2}+b^{2}\right)}{a}y=\frac{8b^{2}}{a}+b+4a
Subtract -\frac{8b^{2}}{a}-2b from both sides of the equation.
y=\frac{4a^{2}+ab+8b^{2}}{2\left(a^{2}+b^{2}\right)}
Divide both sides by \frac{2\left(a^{2}+b^{2}\right)}{a}.
x=\frac{b}{a}\times \frac{4a^{2}+ab+8b^{2}}{2\left(a^{2}+b^{2}\right)}-\frac{4b}{a}-1
Substitute \frac{8b^{2}+ba+4a^{2}}{2\left(a^{2}+b^{2}\right)} for y in x=\frac{b}{a}y-\frac{4b}{a}-1. Because the resulting equation contains only one variable, you can solve for x directly.
x=\frac{b\left(4a^{2}+ab+8b^{2}\right)}{2a\left(a^{2}+b^{2}\right)}-\frac{4b}{a}-1
Multiply \frac{b}{a} times \frac{8b^{2}+ba+4a^{2}}{2\left(a^{2}+b^{2}\right)}.
x=-\frac{2a^{2}+4ab+b^{2}}{2\left(a^{2}+b^{2}\right)}
Add -1-\frac{4b}{a} to \frac{b\left(8b^{2}+ba+4a^{2}\right)}{2a\left(a^{2}+b^{2}\right)}.
x=-\frac{2a^{2}+4ab+b^{2}}{2\left(a^{2}+b^{2}\right)},y=\frac{4a^{2}+ab+8b^{2}}{2\left(a^{2}+b^{2}\right)}
The system is now solved.
ax-by+4b=-a
Consider the first equation. Subtract a from both sides. Anything subtracted from zero gives its negation.
ax-by=-a-4b
Subtract 4b from both sides.
2bx+2ay+b-4a=0
Consider the second equation. Use the distributive property to multiply 2 by bx+ay.
2bx+2ay-4a=-b
Subtract b from both sides. Anything subtracted from zero gives its negation.
2bx+2ay=-b+4a
Add 4a to both sides.
ax+\left(-b\right)y=-a-4b,2bx+2ay=4a-b
Put the equations in standard form and then use matrices to solve the system of equations.
\left(\begin{matrix}a&-b\\2b&2a\end{matrix}\right)\left(\begin{matrix}x\\y\end{matrix}\right)=\left(\begin{matrix}-a-4b\\4a-b\end{matrix}\right)
Write the equations in matrix form.
inverse(\left(\begin{matrix}a&-b\\2b&2a\end{matrix}\right))\left(\begin{matrix}a&-b\\2b&2a\end{matrix}\right)\left(\begin{matrix}x\\y\end{matrix}\right)=inverse(\left(\begin{matrix}a&-b\\2b&2a\end{matrix}\right))\left(\begin{matrix}-a-4b\\4a-b\end{matrix}\right)
Left multiply the equation by the inverse matrix of \left(\begin{matrix}a&-b\\2b&2a\end{matrix}\right).
\left(\begin{matrix}1&0\\0&1\end{matrix}\right)\left(\begin{matrix}x\\y\end{matrix}\right)=inverse(\left(\begin{matrix}a&-b\\2b&2a\end{matrix}\right))\left(\begin{matrix}-a-4b\\4a-b\end{matrix}\right)
The product of a matrix and its inverse is the identity matrix.
\left(\begin{matrix}x\\y\end{matrix}\right)=inverse(\left(\begin{matrix}a&-b\\2b&2a\end{matrix}\right))\left(\begin{matrix}-a-4b\\4a-b\end{matrix}\right)
Multiply the matrices on the left hand side of the equal sign.
\left(\begin{matrix}x\\y\end{matrix}\right)=\left(\begin{matrix}\frac{2a}{a\times 2a-\left(-b\right)\times 2b}&-\frac{-b}{a\times 2a-\left(-b\right)\times 2b}\\-\frac{2b}{a\times 2a-\left(-b\right)\times 2b}&\frac{a}{a\times 2a-\left(-b\right)\times 2b}\end{matrix}\right)\left(\begin{matrix}-a-4b\\4a-b\end{matrix}\right)
For the 2\times 2 matrix \left(\begin{matrix}a&b\\c&d\end{matrix}\right), the inverse matrix is \left(\begin{matrix}\frac{d}{ad-bc}&\frac{-b}{ad-bc}\\\frac{-c}{ad-bc}&\frac{a}{ad-bc}\end{matrix}\right), so the matrix equation can be rewritten as a matrix multiplication problem.
\left(\begin{matrix}x\\y\end{matrix}\right)=\left(\begin{matrix}\frac{a}{a^{2}+b^{2}}&\frac{b}{2\left(a^{2}+b^{2}\right)}\\-\frac{b}{a^{2}+b^{2}}&\frac{a}{2\left(a^{2}+b^{2}\right)}\end{matrix}\right)\left(\begin{matrix}-a-4b\\4a-b\end{matrix}\right)
Do the arithmetic.
\left(\begin{matrix}x\\y\end{matrix}\right)=\left(\begin{matrix}\frac{a}{a^{2}+b^{2}}\left(-a-4b\right)+\frac{b}{2\left(a^{2}+b^{2}\right)}\left(4a-b\right)\\\left(-\frac{b}{a^{2}+b^{2}}\right)\left(-a-4b\right)+\frac{a}{2\left(a^{2}+b^{2}\right)}\left(4a-b\right)\end{matrix}\right)
Multiply the matrices.
\left(\begin{matrix}x\\y\end{matrix}\right)=\left(\begin{matrix}-\frac{2a^{2}+4ab+b^{2}}{2\left(a^{2}+b^{2}\right)}\\\frac{4a^{2}+ab+8b^{2}}{2\left(a^{2}+b^{2}\right)}\end{matrix}\right)
Do the arithmetic.
x=-\frac{2a^{2}+4ab+b^{2}}{2\left(a^{2}+b^{2}\right)},y=\frac{4a^{2}+ab+8b^{2}}{2\left(a^{2}+b^{2}\right)}
Extract the matrix elements x and y.
ax-by+4b=-a
Consider the first equation. Subtract a from both sides. Anything subtracted from zero gives its negation.
ax-by=-a-4b
Subtract 4b from both sides.
2bx+2ay+b-4a=0
Consider the second equation. Use the distributive property to multiply 2 by bx+ay.
2bx+2ay-4a=-b
Subtract b from both sides. Anything subtracted from zero gives its negation.
2bx+2ay=-b+4a
Add 4a to both sides.
ax+\left(-b\right)y=-a-4b,2bx+2ay=4a-b
In order to solve by elimination, coefficients of one of the variables must be the same in both equations so that the variable will cancel out when one equation is subtracted from the other.
2bax+2b\left(-b\right)y=2b\left(-a-4b\right),a\times 2bx+a\times 2ay=a\left(4a-b\right)
To make ax and 2bx equal, multiply all terms on each side of the first equation by 2b and all terms on each side of the second by a.
2abx+\left(-2b^{2}\right)y=-2b\left(a+4b\right),2abx+2a^{2}y=a\left(4a-b\right)
Simplify.
2abx+\left(-2ab\right)x+\left(-2b^{2}\right)y+\left(-2a^{2}\right)y=-2b\left(a+4b\right)+ab-4a^{2}
Subtract 2abx+2a^{2}y=a\left(4a-b\right) from 2abx+\left(-2b^{2}\right)y=-2b\left(a+4b\right) by subtracting like terms on each side of the equal sign.
\left(-2b^{2}\right)y+\left(-2a^{2}\right)y=-2b\left(a+4b\right)+ab-4a^{2}
Add 2bax to -2bax. Terms 2bax and -2bax cancel out, leaving an equation with only one variable that can be solved.
\left(-2a^{2}-2b^{2}\right)y=-2b\left(a+4b\right)+ab-4a^{2}
Add -2b^{2}y to -2a^{2}y.
\left(-2a^{2}-2b^{2}\right)y=-4a^{2}-ab-8b^{2}
Add -2b\left(a+4b\right) to ab-4a^{2}.
y=\frac{4a^{2}+ab+8b^{2}}{2\left(a^{2}+b^{2}\right)}
Divide both sides by -2b^{2}-2a^{2}.
2bx+2a\times \frac{4a^{2}+ab+8b^{2}}{2\left(a^{2}+b^{2}\right)}=4a-b
Substitute \frac{8b^{2}+ab+4a^{2}}{2\left(b^{2}+a^{2}\right)} for y in 2bx+2ay=4a-b. Because the resulting equation contains only one variable, you can solve for x directly.
2bx+\frac{a\left(4a^{2}+ab+8b^{2}\right)}{a^{2}+b^{2}}=4a-b
Multiply 2a times \frac{8b^{2}+ab+4a^{2}}{2\left(b^{2}+a^{2}\right)}.
2bx=-\frac{b\left(2a^{2}+4ab+b^{2}\right)}{a^{2}+b^{2}}
Subtract \frac{a\left(8b^{2}+ab+4a^{2}\right)}{b^{2}+a^{2}} from both sides of the equation.
x=-\frac{2a^{2}+4ab+b^{2}}{2\left(a^{2}+b^{2}\right)}
Divide both sides by 2b.
x=-\frac{2a^{2}+4ab+b^{2}}{2\left(a^{2}+b^{2}\right)},y=\frac{4a^{2}+ab+8b^{2}}{2\left(a^{2}+b^{2}\right)}
The system is now solved.