HP Forums

Full Version: problem with canonical_form
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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=can...10*y%3D-18

canonical form x^2-6*x+y^2+10*y=-18 =>
(x - 3)^2 + (y + 5)^2 - 16 = 0
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.
[Image: compsqu.jpg]

Happy August holidays and best,

Aries Wink
(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]
Reference URL's