0

I have a specific formula = $a$^2 + $b$^3 = $c$^2

and let's say I need to print out $a$ and $c$, but only $b$ is given to us.

Example (I could think of):

B = 3

3 ^ 2 + 3 ^ 3 => 9 + 27 = 36 (6 ^ 2)

So we would just output 3 and 6 since it works based on our formula. I feel like there's some sort of simple mathematical method for doing this in a way where it will always work. I eventually want to program this, but how can I manipulate this so it'll work everything (just by providing $b$)?

In short terms, I want to display the values of $a$ and $c$ where $b$ is given to us, and works with our formula: $a$^2 + $b$^3 = $c$^2

1 Answers1

2

Write the equation as $b^3=c^2-a^2=(c+a)(c-a)$. You need to factor $b^3$ into two factors of the same parity as $c+a$ and $c-a$ are either both even or both odd. For each factorization you can solve the simultaneous equations to get $c$ and $a$.

In your example we can factor $b^3=27=1\cdot 27=3 \cdot 9$ Taking the second $$c+a=9\\c-a=3\\2c=12\\c=6\\a=3$$ Similarly for the first $$c+a=27\\c-a=1\\2c=28\\c=14\\a=13$$ and we also have $13^2+3^3=14^2$

If $b$ is composite there will be more choices.

Ross Millikan
  • 374,822
  • Can you show me with my example above? I'm still confused since I'm trying to understand how I would program this. The way c and a are being manipulated is confusing me a bit. – Jon Snow Dec 05 '20 at 05:16
  • Question: How are you getting 32c = 12c = 6a and same thing for 12c = 28c = 14a? – Jon Snow Dec 05 '20 at 05:33
  • I am not getting either of those. Maybe your browser is not showing the linebreaks in my MathJax. The line $2c=12$ comes from adding the two equations above it. Then $c=6$ comes from dividing by $2$. This is standard algebra for solving simultaneous equations. – Ross Millikan Dec 05 '20 at 05:34