I have tried using subs but it is not working for what I am trying to do.
I have
r2 := (n_x^2+n_y^2-1);
and I want this expression:
E:=hbar*Pi/(2*M*A)*(n_x^2/L+n_y^2/L);
to put r2 in so I can solve for r2 (using maple). Does anyone know what the command is to do this? I cannot seem to articulate what I want well enough to bring it up in the help search!
By assigning a value to r2 you made it (nearly) impossible to evaluate any expression and see an r2 in it. Get rid of that assignment:
Now subs won't work because the expression you want to be r2 doesn't appear as an operand in E. However, you can use
$${\frac {{\it hbar}\,\pi \,{\it r2}}{2\,MAL}}+{\frac {{\it hbar} \,\pi }{2\,MAL}} $$
or
$$ \frac{{\it hbar}\, \pi ({\it r2}+1)}{2\, MAL}$$