I can't solve a simple equation. Help please. - Page 1
Forum section: electronics / general

author: intabits
author_rank: Frequent Contributor
timestamp: February 02, 2021, 12:40:53 pm
content: I haven't routinely juggled algebraic expressions since school over 45 years ago. I do occasionally find myself needing to do so again, and usually with success, but this time I'm stumped.My program's calculation brings me to point where I'm trying to calculate a value from two others already known, and the equation boils down to something of the form:-a = (1/x) - 1/(x+b) (1)I can't solve this (seemingly simple) equation for x.a & b are not constants, they're calculated in preceding steps. Since the equation (1) has only one unknown, I expect that there must be some solution of the form:-x = f(a,b) i.e. some function of a & bThen my program (dealing with resistors in parallel and series) can plug in a & b to get a value for x, and continue on its merry way.But I cannot reduce the two occurrences of x in eqn(1) to just one. I seem only able to make it worse, such as:-x+b = ax(x+b) + x with four occurrences of x.Can someone please provide me with the right hand side of:-x = ?(Or explain why it is not possible)Thanks in advance!

author: mawyatt
author_rank: Super Contributor
timestamp: February 02, 2021, 01:01:56 pm
content: Classic quadric equation of x^2 + bx - b/a.Best,

author: Spike101
author_rank: Contributor
timestamp: February 02, 2021, 01:07:07 pm
content: You can always cheat...https://www.wolframalpha.com/input/?i=solve+a%3D%281%2Fx%29-%281%2F%28x%2Bb%29%29+for+x

author: dmills
author_rank: Super Contributor
timestamp: February 02, 2021, 01:07:25 pm
content: a = (1/x) - 1/(x+b) (1)Multiply by (x+b)a(x+b) = (x+b)/x - (x+b)/(x+b) = x/x + b/x - (x+b)/(x+b) = 1+b/x - 1 = b/xMultiply by xax(x+b) = bsubtract bax^2 + abx -b = 0Divide thru by a.x^2 + bx - b/aSolve as a quadratic by the usual means (Note there are two roots, and values of a and b that will result in x being complex).Someone check my working, I may have screwed up a sign somewhere or something, it has been a while.

author: rf-messkopf
author_rank: Regular Contributor
timestamp: February 02, 2021, 01:07:40 pm
content: Quote from: mawyatt on February 02, 2021, 01:01:56 pmCorrect. More precisely, rearranging yields the equation x^2 + bx - b/a = 0. This has two solutions:\[x_{1,2}=-\frac b2\pm\sqrt{\frac{b^2}{4}+\frac ba}.\]

author: intabits
author_rank: Frequent Contributor
timestamp: February 02, 2021, 07:40:12 pm
content: Thanks to all who replied.Yes, I did manage to get toax^2 + axb - b = 0So I knew it was a quadratic, though I didn't think to divide by a to getx^2 + bx - b/a = 0My usual method was to then try to factorize it into something like(x - 1/a)(x + b) = 0 (incorrect)and then find the roots by seeing when each of the two factors becomes zero.I know that's not always possible, and that the quadratic formula was a method to handle that situation.But although we were taught it, I can't ever recall actually using it!So I didn't, hoping there was some simpler method.Though that is (now) obviously the method to use.I'll blunder on from that basis, and see if I can get the result I'm after.@rf-messkopf Now I'm now more interested in how your notation works. When I look at the quote of your post, it contains\[x_{1,2}=-\frac b2\pm\sqrt{\frac{b^2}{4}+\frac ba}.\]But that previews just as is, without rendering into the maths notation.How does that work?*Update*Ah ha, it works when you actually post it!

author: SilverSolder
author_rank: Super Contributor
timestamp: February 02, 2021, 08:14:25 pm
content: Quote from: Spike101 on February 02, 2021, 01:07:07 pmThat is pretty impressive!

author: Terry Bites
author_rank: Super Contributor
timestamp: February 05, 2021, 01:47:05 pm
content: Just because its my birthday....MS mathematics- Handy, free, works...https://math.microsoft.com/en

author: CJay
author_rank: Super Contributor
timestamp: February 05, 2021, 03:24:15 pm
content: Oh nice, even better the app, you can take pics of handwritten stuff and it'll try to solve

author: Nominal Animal
author_rank: Super Contributor
timestamp: February 05, 2021, 06:11:09 pm
content: wxMaxima (GUI) or Maxima (text only) is also an option:solve(a = (1/x) - 1/(x+b), x);2 2 2 2sqrt(a b + 4 a b) + a b sqrt(a b + 4 a b) - a b[x = - -------------------------, x = -------------------------]2 a 2 aMaximais free, and available forWindows,Mac OS X, Linux (in standard package repositories for each distribution), andFreeBSD via FreshPorts. I suggest installing the graphical version,wxMaxima, though. Documentation is availableherein various forms.If you are writing a program, then settingdisplay2dto false can be nice:display2d: false $solve(a = (1/x) - 1/(x+b), x);[x = -(sqrt(a^2*b^2+4*a*b)+a*b)/(2*a), x = (sqrt(a^2*b^2+4*a*b)-a*b)/(2*a)]

author: SilverSolder
author_rank: Super Contributor
timestamp: February 05, 2021, 07:01:14 pm
content: Quote from: Terry Bites on February 05, 2021, 01:47:05 pmThis is actually rather good - a no BS application! Remember those?To download the last standalone desktop application:https://www.microsoft.com/en-us/download/details.aspx?id=15702You can say "No" to installing the ancient version of DirectX, with no ill effects

author: vad
author_rank: Frequent Contributor
timestamp: February 05, 2021, 07:11:40 pm
content: Another vote for Maxima / wxMaxima.

author: rstofer
author_rank: Super Contributor
timestamp: February 06, 2021, 12:29:17 am
content: You can plug the equation in atwww.symbolab.com, get both solutions.

author: IanB
author_rank: Super Contributor
timestamp: February 06, 2021, 01:14:57 am
content: Quote from: intabits on February 02, 2021, 07:40:12 pmHere is the way to do it if you can't remember the quadratic formula.Start with the reduced quadratic:x² + bx - b/a = 0Now construct a similar equation that is easier to solve:(x + b/2)² = 0If we multiply this out, we get:x² + bx + b²/4 = 0We can make this similar equation the same as the equation we want like this:x² + bx + b²/4 − b²/4 − b/a = x² + bx − b/a = 0But now we are in a position to solve the original equation:(x² + bx + b²/4) − b²/4 − b/a = (x + b/2)² − b²/4 − b/a = 0We have:(x + b/2)² − b²/4 − b/a = 0(x + b/2)² = b²/4 + b/ax + b/2 = ± √(b²/4 + b/a)Therefore:x = − b/2 ± √(b^2/4 + b/a)This is the same answer as already presented above, and this method (called "completing the square") is how the quadratic formula is originally obtained.

author: intabits
author_rank: Frequent Contributor
timestamp: February 12, 2021, 01:42:55 pm
content: Thanks for the explanation. "completing the square" is a familiar term, but I'd long forgotten what it involved.