HP Forums
problem with canonical_form - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html)
+--- Forum: HP Prime (/forum-5.html)
+--- Thread: problem with canonical_form (/thread-11215.html)



problem with canonical_form - compsystems - 08-13-2018 07:35 PM

canonical_form(x^2-6*x+y^2+10*y+18) returns poly1[153+(x-3)^2]

Source:
free book "Doing Mathematics withScientic WorkPlace"
https://www.sciword.co.uk/manuals/

[Image: Doing_Mathematics_with_Scientic_WorkPlac...mage00.png]

http://www.wolframalpha.com/input/?i=canonical+form+x%5E2-6*x%2By%5E2%2B10*y%3D-18

canonical form x^2-6*x+y^2+10*y=-18 =>
(x - 3)^2 + (y + 5)^2 - 16 = 0


RE: problem with canonical_form - JMB - 08-14-2018 08:44 AM

According to the help provided by the calculator and also by the User Guide, canonical_form works with one variable only. Your function has two: x and y.


RE: problem with canonical_form - Aries - 08-15-2018 10:38 AM

[Image: compsqu.jpg]

Happy August holidays and best,

Aries Wink


RE: problem with canonical_form - Komanguy - 08-15-2018 01:44 PM

(08-13-2018 07:35 PM)compsystems Wrote:  canonical_form(x^2-6*x+y^2+10*y+18) returns poly1[153+(x-3)^2]

You got this weird result because your cas variable ‘y’ is no longer symbolic. You must reset it.

Quote:canonical form x^2-6*x+y^2+10*y=-18 =>
(x - 3)^2 + (y + 5)^2 - 16 = 0

Unless I’m wrong, the canonical form of a quadratic expression
ax^2+bx+c is a[(x+b/2a)^2−(b^2−4ac)/4a^2], x is the only variable

If you have two variables you should use the canonical_form fonction for each single variable.

In this example, instead of canonical_form(x^2-6*x+y^2+10*y+18)
you should use
canonical_form(x^2-6*x)+canonical_form(y^2+10*y+18)

It’s more in accordance with the definition of a canonical form.

[Image: 293_B25_FE-5382-449_F-_BDD9-_B321_C9_E88199.jpg]