ASKSAGE: Sage Q&A Forum - Individual question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Wed, 14 Aug 2019 17:56:54 -0500How to expand the result of derivative()?http://ask.sagemath.org/question/47484/how-to-expand-the-result-of-derivative/I ran:
```
derivative(acosh(x), x)
```
and the result was:
```
1/(sqrt(x + 1)*sqrt(x - 1))
```
I personally would prefer `1/sqrt(x^2-1)` as it's an expanded form and I'm wondering how I can get SageMath to show this. I've tried adding `.expand()` afterwards and that made no difference to the result. Wed, 14 Aug 2019 11:15:47 -0500http://ask.sagemath.org/question/47484/how-to-expand-the-result-of-derivative/Answer by ortollj for <p>I ran:</p>
<p><code>
derivative(acosh(x), x)
</code></p>
<p>and the result was:</p>
<p><code>
1/(sqrt(x + 1)*sqrt(x - 1))
</code></p>
<p>I personally would prefer <code>1/sqrt(x^2-1)</code> as it's an expanded form and I'm wondering how I can get SageMath to show this. I've tried adding <code>.expand()</code> afterwards and that made no difference to the result. </p>
http://ask.sagemath.org/question/47484/how-to-expand-the-result-of-derivative/?answer=47485#post-id-47485Hi
I propose this code despite little heavy !
I think it must exist simpler
x=var('x')
d=derivative(acosh(x), x)
show(d.numerator()/sqrt((d.denominator()^2).expand()))Wed, 14 Aug 2019 13:36:18 -0500http://ask.sagemath.org/question/47484/how-to-expand-the-result-of-derivative/?answer=47485#post-id-47485Comment by Emmanuel Charpentier for <p>Hi</p>
<p>I propose this code despite little heavy !
I think it must exist simpler</p>
<pre><code>x=var('x')
d=derivative(acosh(x), x)
show(d.numerator()/sqrt((d.denominator()^2).expand()))
</code></pre>
http://ask.sagemath.org/question/47484/how-to-expand-the-result-of-derivative/?comment=47486#post-id-47486An alternative:
sage: (derivative(acosh(x), x)^2).simplify_full().sqrt()
1/sqrt(x^2 - 1)
but I'm not sanguine about the whole thing ...Wed, 14 Aug 2019 17:56:54 -0500http://ask.sagemath.org/question/47484/how-to-expand-the-result-of-derivative/?comment=47486#post-id-47486