ASKSAGE: Sage Q&A Forum - Individual question feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Sat, 03 Oct 2015 03:44:51 -0500How do i display a derivative using view()https://ask.sagemath.org/question/29671/how-do-i-display-a-derivative-using-view/ I can currently display the form of an integral in latex using:
f(x) = x + x^2
view( integral(f(x),x, hold=True) ) #displays the form of the derivative
But i can't figure out how to do it for a derivative:
f(x) = x + x^2
view( derivative(f(x),x, hold=True) ) #fails
view( derivative(f(x),x) ) # takes derivative then displays answer instead of the problem
Is their any easy way to do this? If not, whats the recommended way to fake it (inline latex etc)?Fri, 02 Oct 2015 03:17:12 -0500https://ask.sagemath.org/question/29671/how-do-i-display-a-derivative-using-view/Answer by tmonteil for <p>I can currently display the form of an integral in latex using:</p>
<pre><code>f(x) = x + x^2
view( integral(f(x),x, hold=True) ) #displays the form of the derivative
</code></pre>
<p>But i can't figure out how to do it for a derivative:</p>
<pre><code>f(x) = x + x^2
view( derivative(f(x),x, hold=True) ) #fails
view( derivative(f(x),x) ) # takes derivative then displays answer instead of the problem
</code></pre>
<p>Is their any easy way to do this? If not, whats the recommended way to fake it (inline latex etc)?</p>
https://ask.sagemath.org/question/29671/how-do-i-display-a-derivative-using-view/?answer=29673#post-id-29673As you can see, the problem is not about viewing the formula in LaTeX/pdf, but about telling Sage not to compute the derivative. Indeed , it seems that the `derivative` method does not support a `hold` argument (yet).
sage: f(x) = x + x^2
sage: derivative(f(x),x)
2*x + 1
sage: derivative(f(x),x, hold=True)
TypeError: derivative() got an unexpected keyword argument 'hold'
Fri, 02 Oct 2015 03:44:57 -0500https://ask.sagemath.org/question/29671/how-do-i-display-a-derivative-using-view/?answer=29673#post-id-29673Comment by kcrisman for <p>As you can see, the problem is not about viewing the formula in LaTeX/pdf, but about telling Sage not to compute the derivative. Indeed , it seems that the <code>derivative</code> method does not support a <code>hold</code> argument (yet).</p>
<pre><code>sage: f(x) = x + x^2
sage: derivative(f(x),x)
2*x + 1
sage: derivative(f(x),x, hold=True)
TypeError: derivative() got an unexpected keyword argument 'hold'
</code></pre>
https://ask.sagemath.org/question/29671/how-do-i-display-a-derivative-using-view/?comment=29685#post-id-29685Apparently the long-delayed http://trac.sagemath.org/ticket/6756 would implement this, or at least *should* implement it but maybe hasn't yet...Sat, 03 Oct 2015 03:44:51 -0500https://ask.sagemath.org/question/29671/how-do-i-display-a-derivative-using-view/?comment=29685#post-id-29685