Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2007

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: express a quadratic, in the form (x+a)^2 + b

  • To: mathgroup at smc.vnet.net
  • Subject: [mg84370] Re: [mg84313] express a quadratic, in the form (x+a)^2 + b
  • From: DrMajorBob <drmajorbob at bigfoot.com>
  • Date: Thu, 20 Dec 2007 00:13:08 -0500 (EST)
  • References: <817096.1198059158886.JavaMail.root@m35>
  • Reply-to: drmajorbob at bigfoot.com

ClearAll[quad]
quad[{c_, b_, a_}] := a (x + b/(2 a))^2 + c - b^2/(4 a)
quad[poly_, x_Symbol] /; PolynomialQ[poly, x] :=
  quad@CoefficientList[poly, x]

quad[x^2 + 4 x + 7, x]

3 + (2 + x)^2

Bobby

On Wed, 19 Dec 2007 03:07:25 -0600, Joseph Fagan  
<noemailplease at nowhere.ru> wrote:

> I'm a Mathematica beginner.
> I wish to express a quadratic, in the form (x+a)^2 + b
> eg to express x^2 + 4x + 7 as (x+2)^2 + 3
> Is there an easy way?
> Thanks
> Joe
>
>
>
>



-- 

DrMajorBob at bigfoot.com


  • Prev by Date: Re: express a quadratic, in the form (x+a)^2 + b
  • Next by Date: Re: express a quadratic, in the form (x+a)^2 + b
  • Previous by thread: Re: express a quadratic, in the form (x+a)^2 + b
  • Next by thread: Re: express a quadratic, in the form (x+a)^2 + b