www.gusucode.com > matlab 案例源码 matlab代码程序 > matlab/DifferentiateProductOfPolynomialsExample.m

    %% Differentiate Product of Polynomials
% Create two vectors to represent the polynomials $a(x)=x^4-2x^3+11$ and
% $b(x)=x^2-10x+15$.

% Copyright 2015 The MathWorks, Inc.

a = [1 -2 0 0 11];
b = [1 -10 15];

%%
% Use |polyder| to calculate 
%
% $$q(x)=\frac{d}{dx} \left[ a(x)b(x) \right].$$
%
q = polyder(a,b)

%%
% The result is 
%
% $$q(x)=6x^5-60x^4+140x^3-90x^2+22x-110.$$
%