MathGroup Archive 2011

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

Search the Archive

Re: Derivative of BernsteinBasis functions

  • To: mathgroup at smc.vnet.net
  • Subject: [mg118355] Re: Derivative of BernsteinBasis functions
  • From: Bob Hanlon <hanlonr at cox.net>
  • Date: Sun, 24 Apr 2011 08:24:47 -0400 (EDT)

{$Version, $ReleaseNumber}

{"8.0 for Mac OS X x86 (64-bit) (February 23, 2011)", 1}

g[x_] = -BernsteinBasis[5, 0, x] + 6 BernsteinBasis[5, 1, x] -
   15 BernsteinBasis[5, 2, x] + 20 BernsteinBasis[5, 3, x] -
   15 BernsteinBasis[5, 4, x] + 6 BernsteinBasis[5, 5, x];

Simplify this prior to taking derivative

g[x_] = FullSimplify[g[x]]

Piecewise[{{-1 + 7*x*(5 + 2*x*(-20 + 3*x*(20 + x*(-25 + 11*x)))), 
   0 <= x <= 1}}, 0]

g''[x]

Piecewise[{{Indeterminate, 
   x == 0 || x == 1}, {35*(-16 + 144*x - 360*x^2 + 264*x^3), 0 < x < 1}}, 0]

To show that this is equivalent to the result from version 7

h[x_] =
  -20 BernsteinBasis[3, 0, x] + 30 (-4 BernsteinBasis[3, 0, x] -
      4 (BernsteinBasis[3, 0, x] - BernsteinBasis[3, 1, x])) -
   75 (4 (BernsteinBasis[3, 0, x] - BernsteinBasis[3, 1, x]) -
      4 (BernsteinBasis[3, 1, x] - BernsteinBasis[3, 2, x])) +
   100 (4 (BernsteinBasis[3, 1, x] - BernsteinBasis[3, 2, x]) -
      4 (BernsteinBasis[3, 2, x] - BernsteinBasis[3, 3, x])) -
   75 (4 (BernsteinBasis[3, 2, x] - BernsteinBasis[3, 3, x]) -
      4 BernsteinBasis[3, 3, x]) + 120 BernsteinBasis[3, 3, x];

Reduce[g''[x] == h[x], x]

0 < x < 1 || x < 0 || x > 1

So they are equal for real x excluding the two indeterminate points.


Bob Hanlon

---- "Rob Y. H. Chai" <yhchai at ucdavis.edu> wrote: 

=============
Hello everyone,

I'm trying to compute the second derivative of a function g[x_] that
involves a combination of Bernstein Basis functions. Mathematica version 7 was able to compute the derivative, but version 8 gave a problem. 

In[1]:= {$Version,$ReleaseNumber}

Out[1]= {7.0 for Microsoft Windows (32-bit) (February 18, 2009),1}

In[2]:= g[x_] = -BernsteinBasis[5,0,x]+6 BernsteinBasis[5,1,x]-15
BernsteinBasis[5,2,x]+20 BernsteinBasis[5,3,x]-15 BernsteinBasis[5,4,x]+6
BernsteinBasis[5,5,x]

Out[2]= -BernsteinBasis[5,0,x]+6 BernsteinBasis[5,1,x]-15
BernsteinBasis[5,2,x]+20 BernsteinBasis[5,3,x]-15 BernsteinBasis[5,4,x]+6
BernsteinBasis[5,5,x]

In[3]:= D[g[x],{x,2}]

Out[3]= -20 BernsteinBasis[3,0,x]+30 (-4 BernsteinBasis[3,0,x]-4
(BernsteinBasis[3,0,x]-BernsteinBasis[3,1,x]))-75 (4
(BernsteinBasis[3,0,x]-BernsteinBasis[3,1,x])-4
(BernsteinBasis[3,1,x]-BernsteinBasis[3,2,x]))+100 (4
(BernsteinBasis[3,1,x]-BernsteinBasis[3,2,x])-4
(BernsteinBasis[3,2,x]-BernsteinBasis[3,3,x]))-75 (4
(BernsteinBasis[3,2,x]-BernsteinBasis[3,3,x])-4 BernsteinBasis[3,3,x])+120
BernsteinBasis[3,3,x]

But 

 

{$Version,$ReleaseNumber}

{8.0 for Microsoft Windows (32-bit) (February 24, 2011),1}

 

D[g[x],{x,2}]

 

Gives an error. Any thoughts? 

 

Thanks.

 

Rob Chai




  • Prev by Date: Re: How to create an animated gif (was: How to roll up
  • Next by Date: Re: need your help
  • Previous by thread: Derivative of BernsteinBasis functions
  • Next by thread: Re: How to create an animated gif (was: How to roll up