Author Topic: I can't solve a simple equation. Help please.  (Read 1637 times)

0 Members and 1 Guest are viewing this topic.

Offline intabitsTopic starter

  • Frequent Contributor
  • **
  • Posts: 319
  • Country: au
I can't solve a simple equation. Help please.
« on: February 02, 2021, 12:40:53 pm »
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 & b

Then 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!



 

Online mawyatt

  • Super Contributor
  • ***
  • Posts: 3270
  • Country: us
Re: I can't solve a simple equation. Help please.
« Reply #1 on: February 02, 2021, 01:01:56 pm »
Classic quadric equation of x^2 + bx - b/a.

Best,
Curiosity killed the cat, also depleted my wallet!
~Wyatt Labs by Mike~
 

Offline Spike101

  • Contributor
  • Posts: 42
  • Country: at
 

Offline dmills

  • Super Contributor
  • ***
  • Posts: 2093
  • Country: gb
Re: I can't solve a simple equation. Help please.
« Reply #3 on: February 02, 2021, 01:07:25 pm »
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/x
Multiply by x
ax(x+b) = b
subtract b
ax^2 + abx -b = 0
Divide thru by a.
x^2 + bx - b/a

Solve 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.
 

Offline rf-messkopf

  • Regular Contributor
  • *
  • Posts: 156
  • Country: de
  • Mario H.
    • Homepage
Re: I can't solve a simple equation. Help please.
« Reply #4 on: February 02, 2021, 01:07:40 pm »
Classic quadric equation of x^2 + bx - b/a.

Correct. 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}.\]
« Last Edit: February 02, 2021, 01:12:15 pm by rf-messkopf »
 

Offline intabitsTopic starter

  • Frequent Contributor
  • **
  • Posts: 319
  • Country: au
Re: I can't solve a simple equation. Help please.
« Reply #5 on: February 02, 2021, 07:40:12 pm »
Thanks to all who replied.

Yes, I did manage to get to
ax^2 + axb - b = 0       

So I knew it was a quadratic, though I didn't think to divide by a to get
x^2 + bx - b/a = 0      

My 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!






 

Offline SilverSolder

  • Super Contributor
  • ***
  • Posts: 6126
  • Country: 00
 

Offline Terry Bites

  • Super Contributor
  • ***
  • Posts: 2393
  • Country: gb
  • Recovering Electrical Engineer
Re: I can't solve a simple equation. Help please.
« Reply #7 on: February 05, 2021, 01:47:05 pm »
Just because its my birthday....
MS mathematics- Handy, free, works... https://math.microsoft.com/en
 
The following users thanked this post: Someone, faraday, intabits

Offline CJay

  • Super Contributor
  • ***
  • Posts: 4136
  • Country: gb
Re: I can't solve a simple equation. Help please.
« Reply #8 on: February 05, 2021, 03:24:15 pm »
Oh nice, even better the app, you can take pics of handwritten stuff and it'll try to solve
 

Offline Nominal Animal

  • Super Contributor
  • ***
  • Posts: 6264
  • Country: fi
    • My home page and email address
Re: I can't solve a simple equation. Help please.
« Reply #9 on: February 05, 2021, 06:11:09 pm »
wxMaxima (GUI) or Maxima (text only) is also an option:
    solve(a = (1/x) - 1/(x+b), x);
                 2  2                           2  2
           sqrt(a  b  + 4 a b) + a b      sqrt(a  b  + 4 a b) - a b
    [x = - -------------------------, x = -------------------------]
                      2 a                            2 a
Maxima is free, and available for Windows, Mac OS X, Linux (in standard package repositories for each distribution), and FreeBSD via FreshPorts.  I suggest installing the graphical version, wxMaxima, though.  Documentation is available here in various forms.

If you are writing a program, then setting display2d to 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)]
 

Offline SilverSolder

  • Super Contributor
  • ***
  • Posts: 6126
  • Country: 00
Re: I can't solve a simple equation. Help please.
« Reply #10 on: February 05, 2021, 07:01:14 pm »
Just because its my birthday.... (Attachment Link)
MS mathematics- Handy, free, works... https://math.microsoft.com/en

This 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=15702

You can say "No" to installing the ancient version of DirectX, with no ill effects
 

Offline vad

  • Frequent Contributor
  • **
  • Posts: 449
  • Country: us
Re: I can't solve a simple equation. Help please.
« Reply #11 on: February 05, 2021, 07:11:40 pm »
Another vote for Maxima / wxMaxima.
 

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 9890
  • Country: us
Re: I can't solve a simple equation. Help please.
« Reply #12 on: February 06, 2021, 12:29:17 am »
You can plug the equation in at www.symbolab.com, get both solutions.

« Last Edit: February 06, 2021, 01:06:33 am by rstofer »
 

Online IanB

  • Super Contributor
  • ***
  • Posts: 11892
  • Country: us
Re: I can't solve a simple equation. Help please.
« Reply #13 on: February 06, 2021, 01:14:57 am »
Thanks to all who replied.

Yes, I did manage to get to
ax^2 + axb - b = 0       

So I knew it was a quadratic, though I didn't think to divide by a to get
x^2 + bx - b/a = 0      

My 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.

Here is the way to do it if you can't remember the quadratic formula.

Start with the reduced quadratic:

x² + bx - b/a = 0

Now construct a similar equation that is easier to solve:

(x + b/2)² = 0

If we multiply this out, we get:

x² + bx + b²/4 = 0

We 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 = 0

But 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 = 0

We have:

(x + b/2)² − b²/4 − b/a = 0
(x + b/2)² = b²/4 + b/a
x + 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.


 
The following users thanked this post: intabits

Offline intabitsTopic starter

  • Frequent Contributor
  • **
  • Posts: 319
  • Country: au
Re: I can't solve a simple equation. Help please.
« Reply #14 on: February 12, 2021, 01:42:55 pm »
Thanks for the explanation. "completing the square" is a familiar term, but I'd long forgotten what it involved.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf