Re: Re: Way to evaluate D[(1-x^2)y''[x],{x,n
- To: mathgroup at smc.vnet.net
- Subject: [mg14982] Re: [mg14961] Re: [mg14914] Way to evaluate D[(1-x^2)y''[x],{x,n
- From: "Fred Simons" <wsgbfs at win.tue.nl>
- Date: Wed, 2 Dec 1998 03:59:03 -0500
- In-reply-to: <366032AD.1C0B956D@col2.telecom.com.co>
- Sender: owner-wri-mathgroup at wolfram.com
Jurgen, I do not completely understand your question, so if this reply is not an answer to your question, please ask again. I think Phillips question was to find the three terms formula for the n-th derivative of (1-x^2)y''[x] automatically, and Mathematica can not do that. So I extended the Mathematica D-function in such a way that the desired result wil be produced. First Unprotect[D], enter the line and Protect[D] again. Now this formula hold only for integer values of n at least equal to the degree of the polynomial. So I used an If-statement with this condition, to make sure that the extension of D does not have an undesired impact on other computations. The formula Phillips was looking for is now obtained in the following way: D[ (1-x^2) y''[x] , {x, n} ] [[2]] One of my colleagues remarked that the implementation is not complete; in the situation with y''[x] replaced with y[x] it does not work. So the following line is better: D[p_ f_[x_], {x_Symbol, n_} ] /;PolynomialQ[p, x]:= If[ Floor[n]==n&& n>=Exponent[p,x], Sum[ Binomial[n,k]D[p, {x,k}] Derivative[n-k][f][x], {k, 0, Exponent[p, x]}] // Evaluate, D[p f[x], {x, n} ] ] Please ask again if I did not reply your question satisfactory. Fred Simons Eindhoven University of Technology