# Revision history [back]

### Echo input in output.

I'm trying to use sage for documentation purposes, and I'm looking for a way to do some of the following.

Enter an equation f(x) = 2x Input f(2) or something close and get back f(2) = 4 instead of just 4.

I'm also looking for a way to input f(x) = 2x^2 Input diff(f(x),x), or an equivalent command and get f'(x) = 4x or d(f(x)/dx = 4x.

And an icing on the cake would being able to input integrate(f(x)dx) and return ∫f(x)dx => 4x + 15 + c

Bassically, if there is a way to the output more verbose, I'd love to know how.

I just started using Sage and I love it, thank you!

### Echo input in output.

I'm trying to use sage for documentation purposes, and I'm looking for a way to do some of the following.

Enter an equation f(x) = 2x Input f(2) or something close and get back f(2) = 4 instead of just 4.

I'm also looking for a way to input f(x) = 2x^2 Input diff(f(x),x), or an equivalent command and get f'(x) = 4x or d(f(x)/dx = 4x.

And an icing on the cake would being able to input integrate(f(x)dx) and return ∫f(x)dx => 4x + 15 + c

Bassically, if there is a way to the output more verbose, I'd love to know how.

I just started using Sage and I love it, thank you!

Edit: Thank you so much for the response @paulmasson

Your word "typesetting" was new to me and helped me find some other posts.

This seems to be my exact question: https://ask.sagemath.org/question/7826/latex-typesetting-for-derivatives-like-g

This one seemed to answer my question, but I don't know if I'm supposed to do this. https://ask.sagemath.org/question/30975/present-sage-output-as-normal-mathematics/

It gave me the idea of using f = function('f',x) == 2*x

I have no clue what function() is, but I'm working on it.

I have no idea how or why this is different from f(x) = 2*x, but it's pretty cool because now diff(f,x) evaulates to d(f(x)/dy = 2 However, it doesn't do diff(f) so well when there are two variables like f(x,y) = x^2 + y^2 .

I also really enjoyed this one: https://ask.sagemath.org/question/24039/showing-both-input-and-output/

### Echo input in output.

I'm trying to use sage for documentation purposes, and I'm looking for a way to do some of the following.

Enter an equation f(x) = 2x Input f(2) or something close and get back f(2) = 4 instead of just 4.

I'm also looking for a way to input f(x) = 2x^2 Input diff(f(x),x), or an equivalent command and get f'(x) = 4x or d(f(x)/dx = 4x.

And an icing on the cake would being able to input integrate(f(x)dx) and return ∫f(x)dx => 4x + 15 + c

Bassically, if there is a way to the output more verbose, I'd love to know how.

I just started using Sage and I love it, thank you!

Edit: Thank you so much for the response @paulmasson

@paulmasson Your word "typesetting" was new to me and helped me find some other posts.

This This seems to be my exact question: https://ask.sagemath.org/question/7826/latex-typesetting-for-derivatives-like-g

This question:

This one seemed to answer my question, but I don't know if I'm supposed to do this. https://ask.sagemath.org/question/30975/present-sage-output-as-normal-mathematics/this.

It gave me the idea of using f = function('f',x) == 2*x

I have no clue what function() is, but I'm working on it.

I have no idea how or why this is different from f(x) = 2*x, but it's pretty cool because now diff(f,x) evaulates to d(f(x)/dy = 2 However, it doesn't do diff(f) so well when there are two variables like f(x,y) = x^2 + y^2 .

I also really enjoyed this one: https://ask.sagemath.org/question/24039/showing-both-input-and-output/one:

Edit: Links, and I'm sorry to the moderator that has to keep approving my edits. Thank you for your time. I promise this will be my last edit.