<html lang="en"> <head> <title>Derivatives and Integrals - Untitled</title> <meta http-equiv="Content-Type" content="text/html"> <meta name="description" content="Untitled"> <meta name="generator" content="makeinfo 4.13"> <link title="Top" rel="start" href="index.html#Top"> <link rel="up" href="Polynomial-Manipulations.html#Polynomial-Manipulations" title="Polynomial Manipulations"> <link rel="prev" href="Products-of-Polynomials.html#Products-of-Polynomials" title="Products of Polynomials"> <link rel="next" href="Polynomial-Interpolation.html#Polynomial-Interpolation" title="Polynomial Interpolation"> <link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage"> <meta http-equiv="Content-Style-Type" content="text/css"> <style type="text/css"><!-- pre.display { font-family:inherit } pre.format { font-family:inherit } pre.smalldisplay { font-family:inherit; font-size:smaller } pre.smallformat { font-family:inherit; font-size:smaller } pre.smallexample { font-size:smaller } pre.smalllisp { font-size:smaller } span.sc { font-variant:small-caps } span.roman { font-family:serif; font-weight:normal; } span.sansserif { font-family:sans-serif; font-weight:normal; } --></style> </head> <body> <div class="node"> <a name="Derivatives-and-Integrals"></a> <p> Next: <a rel="next" accesskey="n" href="Polynomial-Interpolation.html#Polynomial-Interpolation">Polynomial Interpolation</a>, Previous: <a rel="previous" accesskey="p" href="Products-of-Polynomials.html#Products-of-Polynomials">Products of Polynomials</a>, Up: <a rel="up" accesskey="u" href="Polynomial-Manipulations.html#Polynomial-Manipulations">Polynomial Manipulations</a> <hr> </div> <h3 class="section">27.4 Derivatives and Integrals</h3> <p>Octave comes with functions for computing the derivative and the integral of a polynomial. The functions <code>polyderiv</code> and <code>polyint</code> both return new polynomials describing the result. As an example we'll compute the definite integral of p(x) = x^2 + 1 from 0 to 3. <pre class="example"> c = [1, 0, 1]; integral = polyint(c); area = polyval(integral, 3) - polyval(integral, 0) ⇒ 12 </pre> <!-- ./polynomial/polyderiv.m --> <p><a name="doc_002dpolyderiv"></a> <div class="defun"> — Function File: <b>polyderiv</b> (<var>c</var>)<var><a name="index-polyderiv-2040"></a></var><br> — Function File: [<var>q</var>] = <b>polyderiv</b> (<var>b, a</var>)<var><a name="index-polyderiv-2041"></a></var><br> — Function File: [<var>q</var>, <var>r</var>] = <b>polyderiv</b> (<var>b, a</var>)<var><a name="index-polyderiv-2042"></a></var><br> <blockquote><p>Return the coefficients of the derivative of the polynomial whose coefficients are given by vector <var>c</var>. If a pair of polynomials is given <var>b</var> and <var>a</var>, the derivative of the product is returned in <var>q</var>, or the quotient numerator in <var>q</var> and the quotient denominator in <var>r</var>. <!-- Texinfo @sp should work but in practice produces ugly results for HTML. --> <!-- A simple blank line produces the correct behavior. --> <!-- @sp 1 --> <p class="noindent"><strong>See also:</strong> <a href="doc_002dpoly.html#doc_002dpoly">poly</a>, <a href="doc_002dpolyinteg.html#doc_002dpolyinteg">polyinteg</a>, <a href="doc_002dpolyreduce.html#doc_002dpolyreduce">polyreduce</a>, <a href="doc_002droots.html#doc_002droots">roots</a>, <a href="doc_002dconv.html#doc_002dconv">conv</a>, <a href="doc_002ddeconv.html#doc_002ddeconv">deconv</a>, <a href="doc_002dresidue.html#doc_002dresidue">residue</a>, <a href="doc_002dfilter.html#doc_002dfilter">filter</a>, <a href="doc_002dpolygcd.html#doc_002dpolygcd">polygcd</a>, <a href="doc_002dpolyval.html#doc_002dpolyval">polyval</a>, <a href="doc_002dpolyvalm.html#doc_002dpolyvalm">polyvalm</a>. </p></blockquote></div> <!-- ./polynomial/polyder.m --> <p><a name="doc_002dpolyder"></a> <div class="defun"> — Function File: <b>polyder</b> (<var>c</var>)<var><a name="index-polyder-2043"></a></var><br> — Function File: [<var>q</var>] = <b>polyder</b> (<var>b, a</var>)<var><a name="index-polyder-2044"></a></var><br> — Function File: [<var>q</var>, <var>r</var>] = <b>polyder</b> (<var>b, a</var>)<var><a name="index-polyder-2045"></a></var><br> <blockquote><p>See polyderiv. </p></blockquote></div> <!-- ./deprecated/polyinteg.m --> <p><a name="doc_002dpolyinteg"></a> <div class="defun"> — Function File: <b>polyinteg</b> (<var>c</var>)<var><a name="index-polyinteg-2046"></a></var><br> <blockquote><p>Return the coefficients of the integral of the polynomial whose coefficients are represented by the vector <var>c</var>. <p>The constant of integration is set to zero. <!-- Texinfo @sp should work but in practice produces ugly results for HTML. --> <!-- A simple blank line produces the correct behavior. --> <!-- @sp 1 --> <p class="noindent"><strong>See also:</strong> <a href="doc_002dpolyint.html#doc_002dpolyint">polyint</a>, <a href="doc_002dpoly.html#doc_002dpoly">poly</a>, <a href="doc_002dpolyderiv.html#doc_002dpolyderiv">polyderiv</a>, <a href="doc_002dpolyreduce.html#doc_002dpolyreduce">polyreduce</a>, <a href="doc_002droots.html#doc_002droots">roots</a>, <a href="doc_002dconv.html#doc_002dconv">conv</a>, <a href="doc_002ddeconv.html#doc_002ddeconv">deconv</a>, <a href="doc_002dresidue.html#doc_002dresidue">residue</a>, <a href="doc_002dfilter.html#doc_002dfilter">filter</a>, <a href="doc_002dpolyval.html#doc_002dpolyval">polyval</a>, <a href="doc_002dpolyvalm.html#doc_002dpolyvalm">polyvalm</a>. </p></blockquote></div> <!-- ./polynomial/polyint.m --> <p><a name="doc_002dpolyint"></a> <div class="defun"> — Function File: <b>polyint</b> (<var>c, k</var>)<var><a name="index-polyint-2047"></a></var><br> <blockquote><p>Return the coefficients of the integral of the polynomial whose coefficients are represented by the vector <var>c</var>. The variable <var>k</var> is the constant of integration, which by default is set to zero. <!-- Texinfo @sp should work but in practice produces ugly results for HTML. --> <!-- A simple blank line produces the correct behavior. --> <!-- @sp 1 --> <p class="noindent"><strong>See also:</strong> <a href="doc_002dpoly.html#doc_002dpoly">poly</a>, <a href="doc_002dpolyderiv.html#doc_002dpolyderiv">polyderiv</a>, <a href="doc_002dpolyreduce.html#doc_002dpolyreduce">polyreduce</a>, <a href="doc_002droots.html#doc_002droots">roots</a>, <a href="doc_002dconv.html#doc_002dconv">conv</a>, <a href="doc_002ddeconv.html#doc_002ddeconv">deconv</a>, <a href="doc_002dresidue.html#doc_002dresidue">residue</a>, <a href="doc_002dfilter.html#doc_002dfilter">filter</a>, <a href="doc_002dpolyval.html#doc_002dpolyval">polyval</a>, <a href="doc_002dpolyvalm.html#doc_002dpolyvalm">polyvalm</a>. </p></blockquote></div> </body></html>