<?xml version="1.0" encoding="utf-8" ?> <!-- for emacs: -*- coding: utf-8 -*- --> <!-- Apache may like this line in the file .htaccess: AddCharset utf-8 .html --> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN" "http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg-flat.dtd" > <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head><title>diff -- differentiate or take difference</title> <link rel="stylesheet" type="text/css" href="../../../../Macaulay2/Style/doc.css"/> </head> <body> <table class="buttons"> <tr> <td><div><a href="_diff_lp__Ring__Element_cm__Ring__Element_rp.html">next</a> | <a href="_dictionary__Path.html">previous</a> | <a href="_diff_spand_spcontract.html">forward</a> | <a href="_dictionary__Path.html">backward</a> | up | <a href="index.html">top</a> | <a href="master.html">index</a> | <a href="toc.html">toc</a> | <a href="http://www.math.uiuc.edu/Macaulay2/">Macaulay2 web site</a></div> </td> </tr> </table> <hr/> <div><h1>diff -- differentiate or take difference</h1> <div class="single"><h2>Synopsis</h2> <ul><li><div class="list"><dl class="element"><dt class="heading">Usage: </dt><dd class="value"><div><tt>diff(f,g) or diff(P) or diff(P,i)</tt></div> </dd></dl> </div> </li> </ul> </div> <div class="single"><h2>Description</h2> <div>This function has two different uses. The most common use is for differentiation: differentiate the second input by the first.<p/> The second use, less common but sometimes useful, is to compute the difference polynomial of a Hilbert polynomial.<p/> The arguments can also be ring elements or vectors.<table class="examples"><tr><td><pre>i1 : R = ZZ[x,y,z] o1 = R o1 : PolynomialRing</pre> </td></tr> <tr><td><pre>i2 : f = vars R ** vars R o2 = | x2 xy xz xy y2 yz xz yz z2 | 1 9 o2 : Matrix R <--- R</pre> </td></tr> <tr><td><pre>i3 : diff(transpose vars R, f) o3 = {1} | 2x y z y 0 0 z 0 0 | {1} | 0 x 0 x 2y z 0 z 0 | {1} | 0 0 x 0 0 y x y 2z | 3 9 o3 : Matrix R <--- R</pre> </td></tr> <tr><td><pre>i4 : diff(x, f) o4 = | 2x y z y 0 0 z 0 0 | 1 9 o4 : Matrix R <--- R</pre> </td></tr> <tr><td><pre>i5 : diff(y, f) o5 = | 0 x 0 x 2y z 0 z 0 | 1 9 o5 : Matrix R <--- R</pre> </td></tr> <tr><td><pre>i6 : diff(z, f) o6 = | 0 0 x 0 0 y x y 2z | 1 9 o6 : Matrix R <--- R</pre> </td></tr> </table> </div> </div> <div class="single"><h2>See also</h2> <ul><li><span><a href="_diff_spand_spcontract.html" title="">diff and contract</a></span></li> <li><span><a href="_diff_sq_lp__Matrix_cm__Matrix_rp.html" title="differentiate a matrix by a matrix, the dual notion">diff'</a> -- differentiate a matrix by a matrix, the dual notion</span></li> <li><span><a href="_contract.html" title="contract one matrix by another">contract</a> -- contract one matrix by another</span></li> <li><span><a href="_jacobian.html" title="the Jacobian matrix of partial derivatives">jacobian</a> -- the Jacobian matrix of partial derivatives</span></li> <li><span><a href="_hilbert__Polynomial.html" title="compute the Hilbert polynomial">hilbertPolynomial</a> -- compute the Hilbert polynomial</span></li> </ul> </div> <div class="waystouse"><h2>Ways to use <tt>diff</tt> :</h2> <ul><li><span><a href="_diff_lp__Matrix_cm__Matrix_rp.html" title="differentiate a matrix by a matrix">diff(Matrix,Matrix)</a> -- differentiate a matrix by a matrix</span></li> <li><span>diff(Matrix,Vector), see <span><a href="_diff_lp__Matrix_cm__Matrix_rp.html" title="differentiate a matrix by a matrix">diff(Matrix,Matrix)</a> -- differentiate a matrix by a matrix</span></span></li> <li><span>diff(RingElement,Vector), see <span><a href="_diff_lp__Matrix_cm__Matrix_rp.html" title="differentiate a matrix by a matrix">diff(Matrix,Matrix)</a> -- differentiate a matrix by a matrix</span></span></li> <li><span>diff(Vector,Matrix), see <span><a href="_diff_lp__Matrix_cm__Matrix_rp.html" title="differentiate a matrix by a matrix">diff(Matrix,Matrix)</a> -- differentiate a matrix by a matrix</span></span></li> <li><span>diff(Vector,RingElement), see <span><a href="_diff_lp__Matrix_cm__Matrix_rp.html" title="differentiate a matrix by a matrix">diff(Matrix,Matrix)</a> -- differentiate a matrix by a matrix</span></span></li> <li><span>diff(Vector,Vector), see <span><a href="_diff_lp__Matrix_cm__Matrix_rp.html" title="differentiate a matrix by a matrix">diff(Matrix,Matrix)</a> -- differentiate a matrix by a matrix</span></span></li> <li><span><a href="_diff_lp__Matrix_cm__Ring__Element_rp.html" title="differentiation">diff(Matrix,RingElement)</a> -- differentiation</span></li> <li><span><a href="_diff_lp__Projective__Hilbert__Polynomial_rp.html" title="">diff(ProjectiveHilbertPolynomial)</a></span></li> <li><span><a href="_diff_lp__Projective__Hilbert__Polynomial_cm__Z__Z_rp.html" title="">diff(ProjectiveHilbertPolynomial,ZZ)</a></span></li> <li><span><a href="_diff_lp__Ring__Element_cm__Matrix_rp.html" title="differentiate each entry of a matrix">diff(RingElement,Matrix)</a> -- differentiate each entry of a matrix</span></li> <li><span><a href="_diff_lp__Ring__Element_cm__Ring__Element_rp.html" title="differentiation">diff(RingElement,RingElement)</a> -- differentiation</span></li> </ul> </div> <div><h3>Menu</h3> <h4>differentiation</h4> <ul><li><span><a href="_diff_lp__Ring__Element_cm__Ring__Element_rp.html" title="differentiation">diff(RingElement,RingElement)</a> -- differentiation</span></li> <li><span><a href="_diff_lp__Ring__Element_cm__Matrix_rp.html" title="differentiate each entry of a matrix">diff(RingElement,Matrix)</a> -- differentiate each entry of a matrix</span></li> <li><span><a href="_diff_lp__Matrix_cm__Ring__Element_rp.html" title="differentiation">diff(Matrix,RingElement)</a> -- differentiation</span></li> <li><span><a href="_diff_lp__Matrix_cm__Matrix_rp.html" title="differentiate a matrix by a matrix">diff(Matrix,Matrix)</a> -- differentiate a matrix by a matrix</span></li> </ul> <h4>difference operator for Hilbert polynomials</h4> <ul><li><span><a href="_diff_lp__Projective__Hilbert__Polynomial_rp.html" title="">diff(ProjectiveHilbertPolynomial)</a></span></li> <li><span><a href="_diff_lp__Projective__Hilbert__Polynomial_cm__Z__Z_rp.html" title="">diff(ProjectiveHilbertPolynomial,ZZ)</a></span></li> </ul> </div> </div> </body> </html>