Given a expression (polynomial, or any equation in general) such as
a s^2+b = 0
I want to solve for s^2, to get s^2 = -b/a. We all know that one can't just write
Solve[eq==0,s^2]
because s^2 is not a 'variable'. only s is a 'variable'. So what I do is
eq = a s^2+b;
sol = First@Solve[eq==0/.s^2->z,z];
z/.sol
-(b/a)
I was wondering if there is a way to do the above, without the intermediate variable substitution? I tried many commands, but no success (reduce, collect, eliminate, factor. etc...).
thanks --Nasser
One way is to solve for s
and then square it...
eq=a s^2+b;
sol=#^2 &@ (s/.Solve[eq==0,s])//DeleteDuplicates
Out[1]= {-(b/a)}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With