Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

calculate vertex of a parabola

44 views
Skip to first unread message

Momo K

unread,
Sep 25, 2010, 2:21:05 AM9/25/10
to
Hello,

please excuse me for my language but I am German.

What I wanna do is to calculate the vertex of a parabola or its mathematic
equoation of its vertex.
E. g. if I have a equation of the form "a*x^2 + b*x + c = f(x)", I want an
output like the following:
"a*(x-g)+h = f(x)"

I already tried with the command factor, but I didn'T found any possibility
to transform the equoation from above into the last one.

Thank you
Momo


PS: I am really surprised; I thought, that this would be the first or second
hit in documentation of Mathematica, but even with Google, I didn't found
anything.


Sjoerd C. de Vries

unread,
Sep 26, 2010, 2:43:56 AM9/26/10
to
I'm not sure that I understand you correctly. The vertex, or minimum
or maximum value of a parabola can be found by setting the derivative
of its equation equal to zero and solving for x:

In[8]:= D[a*x^2 + b*x + c, x]

Out[8]= b + 2 a x

In[9]:= Solve[b + 2 a x == 0, x]

Out[9]= {{x -> -(b/(2 a))}}

So the x-coordinate of the vertex is -b/(2a) and the y-coordinate is
given by:

In[10]:= a*x^2 + b*x + c /. x -> -(b/(2 a))

Out[10]= -(b^2/(4 a)) + c

So the vertex doesn't depend on x as you seem to assume. Your problem
is not really a Mathematica problem, it's more a problem of
mathematics (or actually your grasp of it).

Cheers -- Sjoerd

E. Pérez Herrero

unread,
Sep 26, 2010, 2:43:23 AM9/26/10
to
(* The function *)

F[x_] :=a*x^2+b*x+c

(* Its derivative*)

D[F[x], x]

(* The vertex: *)

Solve[D[F[x], x] == 0, x]

(* Vertex coordinates*)

{x, F[x]} /. Solve[D[F[x], x] == 0, x]


Helen Read

unread,
Sep 27, 2010, 5:47:28 AM9/27/10
to
On 9/26/2010 2:43 AM, Sjoerd C. de Vries wrote:
> On Sep 25, 8:21 am, Momo K<momok1...@googlemail.com> wrote:
>>
>> What I wanna do is to calculate the vertex of a parabola or its mathematic
>> equoation of its vertex.
>> E. g. if I have a equation of the form "a*x^2 + b*x + c = f(x)", I want an
>> output like the following:
>> "a*(x-g)+h = f(x)"
>
> I'm not sure that I understand you correctly. The vertex, or minimum
> or maximum value of a parabola can be found by setting the derivative
> of its equation equal to zero and solving for x:
>>
>> In[8]:= D[a*x^2 + b*x + c, x]
>>
>> Out[8]= b + 2 a x
>>
>> In[9]:= Solve[b + 2 a x == 0, x]
>

>> So the vertex doesn't depend on x as you seem to assume. Your problem


>> is not really a Mathematica problem, it's more a problem of
>> mathematics (or actually your grasp of it).

A more elementary (non-calculus) method of finding the vertex is to
complete the square, which is what the OP asked about. I think the OP
meant to write
a*(x-g)^2+h = f(x) and accidentally left off the square.

Here's one way to do it.

If we want to write y=a x^2 + b x + c
in the form y=a (x - u)^2 + v

Try expanding the second form, than match coefficients.

Expand[a (x - u)^2 + v]

This gives:

a u^2 + v - 2 a u x + a x^2

Now match coefficients and solve for u and v.

Solve[{-2 a u == b, a u^2 + v == c}, {u, v}]


--
Helen Read
University of Vermont

Murray Eisenberg

unread,
Sep 28, 2010, 6:06:31 AM9/28/10
to
In his "Presentations" add-on application, David Park has a function
CompleteTheSquare that can save you the effort of carrying out the
manipulations:

<<Presentations`

CompleteTheSquare[a x^2 + b x + c, x] // InputForm
-b^2/(4*a) + c + a*(b/(2*a) + x)^2

(I used InputForm so as to produce linear output suitable for e-mail.)

--
Murray Eisenberg mur...@math.umass.edu
Mathematics & Statistics Dept.
Lederle Graduate Research Tower phone 413 549-1020 (H)
University of Massachusetts 413 545-2859 (W)
710 North Pleasant Street fax 413 545-1801
Amherst, MA 01003-9305

Momo K

unread,
Sep 28, 2010, 6:07:36 AM9/28/10
to
Hello,

after many misunderstandings, I present the "pen and paper-method":


a * x^2 + b*x + c
=a (*x^2 + (b*x)/2*) + c

Now I set (from the underlined from above):
z = x ^ 2 + (b * x)/2
= x ^ 2 + (b * x)/2 + (b/2)^2 - (b/2)^2 ;add term to have form of
a binomial theorem (a+b)^2 = a^2 + 2*a*b + b^2 = (a+b)^2
= (x+(b/2))^2 - (b/2)^2

Now I continue with both terms:

a ((x+(b/2)^2)^2 - (b/2)^2) + c
=a(x+(b/2))^2 - a(b/2)^2 + c

So, my vertex is at X: -(b/2)^2
Y: -a(b/2)^2 + c

I hope this is correct and I didn't miscalculated...
My question now is if there is a comfortable way to calculate form of the
vertex of the parabola.

Thanks

PS: Yes, I've never used derivats because I'm 16 and in 11th form/grade.


Helen Read

unread,
Sep 29, 2010, 4:12:09 AM9/29/10
to
On 9/28/2010 6:06 AM, Murray Eisenberg wrote:
> In his "Presentations" add-on application, David Park has a function
> CompleteTheSquare that can save you the effort of carrying out the
> manipulations:
>
> <<Presentations`
>
> CompleteTheSquare[a x^2 + b x + c, x] // InputForm
> -b^2/(4*a) + c + a*(b/(2*a) + x)^2


Personally, I'd like my students to understand how to do it the more
effortful way :-)

Murray Eisenberg

unread,
Sep 30, 2010, 4:54:23 AM9/30/10
to
Yes, of course when students are learning about completing the square,
we want them to carry out the steps involved.

But once they have mastered it, to continue to insist they carry out
those steps can become as pointless as to insist, for example, that they
still extract square-roots using a paper-and-pencil algorithm.

On 9/29/2010 4:12 AM, Helen Read wrote:
> On 9/28/2010 6:06 AM, Murray Eisenberg wrote:

>> In his "Presentations" add-on application, David Park has a function
>> CompleteTheSquare that can save you the effort of carrying out the
>> manipulations:
>>
>> <<Presentations`
>>
>> CompleteTheSquare[a x^2 + b x + c, x] // InputForm
>> -b^2/(4*a) + c + a*(b/(2*a) + x)^2
>
>

> Personally, I'd like my students to understand how to do it the more
> effortful way :-)
>
> --
> Helen Read
> University of Vermont
>
>

--

0 new messages