Thread: Steps of deriving a complicated algebra equation

1. Steps of deriving a complicated algebra equation

Hello guys,

I am currently working on a physics paper, and in it there is an equation I need to show how to derive. The equation is (it's not in its original form because it has variables containing two letters, and even though one might say it makes no difference, it actually makes the equation just a bit easier to work with)

where I need to isolate q and express it in terms of all the other variables. So as you may figure out, I used Wolfram|Alpha to help me, and it gave me the following:

I wrote a calculator in Python to verify that this equation does indeed work. If you solve for q knowing the values of all the other variables in the original equation and then plug in that value for q back into the original equation, both sides equal each other. Basically, this derivation is working flawlessly for any values.
The problem is that I need to know the steps to deriving this equation. I have attempted completing the square for this problem twice, each a little differently, but both got me different results. I realize that either I messed up somewhere and I did not notice, or to derive this equation, completing the square does not work. But if you try going backwards from the Wolfram|Alpha solution, it does not look like the result of completing the square.
Is it possible to somehow derive the second equation from the first one showing all the steps, or just figure out a different differentiation that works with steps (because Wolfram|Alpha doesn't want to show me the steps)?

2. Re: Steps of deriving a complicated algebra equation

There seems to be a variable "x" in the original (under the d^2).
However, I see no such variable in the solution. Am I blind?!

3. Re: Steps of deriving a complicated algebra equation

Originally Posted by DenisB
There seems to be a variable "x" in the original (under the d^2).
However, I see no such variable in the solution. Am I blind?!
No, you're not blind, I see that the image resolution is too small to make out the term under d^2 clearly. The term under the d^2 is the exact same thing as the expression in the parentheses in the beginning of the equation. It is (1-(s/r)+(((q^2*g)/c^4)*k)/r^2)

4. Re: Steps of deriving a complicated algebra equation

Originally Posted by IvanM
The term under the d^2 is the exact same thing as the expression in the parentheses in the beginning of the equation.
It is (1-(s/r)+(((q^2*g)/c^4)*k)/r^2)
Gotcha!
Also seems to me you could greatly reduce the "writing work" by letting u = r^2(h^2 + sin^2(e)p^2).
Get my drift?

5. Re: Steps of deriving a complicated algebra equation

Originally Posted by DenisB
Gotcha!
Also seems to me you could greatly reduce the "writing work" by letting u = r^2(h^2 + sin^2(e)p^2).
Get my drift?
Yeah, that's actually really helpful, thanks! The amount of writing may cause problems like making little mistakes in the derivation. For the derivation, I was thinking a possible way to derive for q is to divide both sides by c^2*t^2 and then multiply by (1-(s/r)+(((q^2*g)/c^4)*k)/r^2), and try completing the square from there to get (1-(s/r)+(((q^2*g)/c^4)*k)/r^2) in terms of other variables. Solving for q shouldn't be a problem there. However, I tried to do that before you suggested the shortcut and it was a lot of writing. But I reviewed the steps very carefully, and the original equation and the equation I derived did not agree with each other. I'll try that again with the nicer shortcut, but I'm also curious about how Wolfram|Alpha got the equation pictured in my post.

Many thanks!

6. Re: Steps of deriving a complicated algebra equation

Originally Posted by IvanM
Yeah, that's actually really helpful, thanks! The amount of writing may cause problems like making little mistakes in the derivation. For the derivation, I was thinking a possible way to derive for q is to divide both sides by c^2*t^2 and then multiply by (1-(s/r)+(((q^2*g)/c^4)*k)/r^2), and try completing the square from there to get (1-(s/r)+(((q^2*g)/c^4)*k)/r^2) in terms of other variables. Solving for q shouldn't be a problem there. However, I tried to do that before you suggested the shortcut and it was a lot of writing. But I reviewed the steps very carefully, and the original equation and the equation I derived did not agree with each other. I'll try that again with the nicer shortcut, but I'm also curious about how Wolfram|Alpha got the equation pictured in my post.

Many thanks!
I don't understand. If you multiply through like I suggested you only have terms in $\displaystyle q^2$. There are no terms linear in q so you don't need to complete the square on anything. Am I missing something?

-Dan

7. Re: Steps of deriving a complicated algebra equation

Originally Posted by IvanM
It is (1-(s/r)+(((q^2*g)/c^4)*k)/r^2)
Any reasons you're using 5 sets of brackets? NONE are required.

And: v = 1 - s/r ... why not?!!

8. Re: Steps of deriving a complicated algebra equation

Originally Posted by topsquark
I don't understand. If you multiply through like I suggested you only have terms in $\displaystyle q^2$. There are no terms linear in q so you don't need to complete the square on anything. Am I missing something?

-Dan
No, what I did for completing the square is not for q^2, but for the term 1-s/r+((q^2*g/c^4)*k)/r^2. And then I subtracted 1, added s/r, multiplied by r^2, multiplied by c^4, divided by g*k, and then took the square root of q^2 to get q in terms of other variables. However, that doesn't seem to work, because once you plug that value into the first equation, it has no solution.

10. Re: Steps of deriving a complicated algebra equation

Originally Posted by IvanM
No, what I did for completing the square is not for q^2, but for the term 1-s/r+((q^2*g/c^4)*k)/r^2. And then I subtracted 1, added s/r, multiplied by r^2, multiplied by c^4, divided by g*k, and then took the square root of q^2 to get q in terms of other variables. However, that doesn't seem to work, because once you plug that value into the first equation, it has no solution.
You're over-thinking this. Just collect the terms in q^2.

-Dan

11. Re: Steps of deriving a complicated algebra equation

a = 1 - s/r
b = g*k / (c^4 * r^2)
d = d^2
q = q^2
u = c^2 * t^2
v = r^2 * (h^2 + sin^2 (e) p^2)

q = [-2a * u +- sqrt(4 * d * u + (u + v)^2) + u + v] / [2 * b * u]

12. Re: Steps of deriving a complicated algebra equation

Originally Posted by DenisB
a = 1 - s/r
b = g*k / (c^4 * r^2)
d = d^2
q = q^2
u = c^2 * t^2
v = r^2 * (h^2 + sin^2 (e) p^2)

q = [-2a * u +- sqrt(4 * d * u + (u + v)^2) + u + v] / [2 * b * u]
Thank you, but I do not completely understand how to arrive to that. According to your substitutions, the original equation would be -u = -u(a+qb)+(d/(a+qb))+v. If you multiply it by -1, it would make it easier by making the equation u = u(a+qb)-(d/(a+qb))-v. There is still the (a+qb) term in the denominator of one term, so the only way I see of getting out of that is to multiply by (a+qb) which would make the first term u(a+qb)^2. And from there I only could complete the square. The final answer I got is q = {sqrt[((v+u)^2)/u^2 + d/u] + (v+u)/a - a}/b

Sorry for not responding earlier, I was busy with multiple school projects.

13. Re: Steps of deriving a complicated algebra equation

Originally Posted by DenisB
a = 1 - s/r
b = g*k / (c^4 * r^2)
d = d^2
q = q^2
u = c^2 * t^2
v = r^2 * (h^2 + sin^2 (e) p^2)

q = [-2a * u +- sqrt(4 * d * u + (u + v)^2) + u + v] / [2 * b * u]
Originally Posted by IvanM
Thank you, but I do not completely understand how to arrive to that. According to your substitutions, the original equation would be -u = -u(a+qb)+(d/(a+qb))+v. If you multiply it by -1, it would make it easier by making the equation u = u(a+qb)-(d/(a+qb))-v. There is still the (a+qb) term in the denominator of one term, so the only way I see of getting out of that is to multiply by (a+qb) which would make the first term u(a+qb)^2. And from there I only could complete the square. The final answer I got is q = {sqrt[((v+u)^2)/u^2 + d/u] + (v+u)/a - a}/b

Sorry for not responding earlier, I was busy with multiple school projects.
Disregard my last response! It is all figured out! Thank you guys so much, it would have been a long while to figure out a working way to solve this problem had you not helped me! Many thanks, I really appreciate your help

Thanks,
Ivan