How to subtract two equations? I am working on a physics problem where I am told that there are two questions:
EQ1:
$$ W = \left(\frac{\mu_0}{2\pi}\right)\left(\frac{L}{R}\right)I_1^2+I_1LB_{e,z} $$
EQ2:
$$ W = \left(\frac{\mu_0}{2\pi}\right)\left(\frac{L}{R}\right)I_2^2-I_2LB_{e,z} $$
Supposedly, if you subtract E2 from E1 it equals:
$$ B_{e,z} = \left(\frac{\mu_0}{2\pi R}\right)(I_2-I_1) $$
How is this possible? Can someone explain this to me?
 A: Subtracting the two equations you get
\begin{align}
 W -W &= \left(\frac{\mu_0}{2\pi}\right)\left(\frac{L}{R}\right)I_1^2+I_1LB_{e,z} -\left(\frac{\mu_0}{2\pi}\right)\left(\frac{L}{R}\right)I_2^2+I_2LB_{e,z} \\[2ex]
 0 &= \left(\frac{\mu_0}{2\pi}\right)\left(\frac{L}{R}\right)(I_1^2-I_2^2)+(I_1+I_2)LB_{e,z}  \\[2ex]
 -(I_1+I_2)LB_{e,z} &= \left(\frac{\mu_0}{2\pi}\right)\left(\frac{L}{R}\right)(I_1^2-I_2^2)  \\[2ex]
 (I_1+I_2)B_{e,z} &= \left(\frac{\mu_0}{2\pi}\right)\left(\frac{1}{R}\right)(I_2^2-I_1^2)  \\[2ex]
 B_{e,z} &= \left(\frac{\mu_0}{2\pi R}\right)\frac{(I_2^2-I_1^2)}{(I_1+I_2)}  \\[2ex]
\end{align}
Finally, notice that
\begin{align}
\frac{(I_2^2-I_1^2)}{(I_1+I_2)}  &= \frac{(I_2-I_1)(I_1+I_2)}{(I_2+I_1)}= (I_1-I_2).
\end{align}
A: Subtracting the second equation from the first,
\begin{align*}
W-W &= \left(\frac{\mu_0}{2\pi}\right) \left(\frac{L}{R}\right) I_1^2+I_1LB_{e,z} - \left(\left(\frac{\mu_0}{2\pi}\right) \left(\frac{L}{R}\right) I_2^2-I_2LB_{e,z}\right)\\
0 &= \left(\frac{\mu_0}{2\pi}\right) \left(\frac{L}{R}\right) I_1^2- \left(\frac{\mu_0}{2\pi}\right) \left(\frac{L}{R}\right) I_2^2+(I_1LB_{e,z}+I_2LB_{e,z} )\\
-(I_1LB_{e,z}+I_2LB_{e,z})&=\left(\frac{\mu_0}{2\pi}\right) \left(\frac{L}{R}\right) I_1^2-\left(\frac{\mu_0}{2\pi}\right) \left(\frac{L}{R}\right) I_2^2\\
-B_{e,z}(I_1+I_2)L &= \frac{\mu_0}{2 \pi R}(I_1^2-I_2^2) L \\
-B_{e,z}(I_1+I_2)L &= \frac{\mu_0}{2 \pi R}(I_1-I_2)(I_1+I_2) L 
\end{align*}
Assuming $L \neq 0$ and $I_1+I_2 \neq 0$ we can cancel those on both sides to get $-B_{e,z} = \frac{\mu_0}{2\pi R}(I_1-I_2)$, so $B_{e,z}=\frac{\mu_0}{2\pi R}(I_2-I_1)$.
