In the following example, we will see how Sage can be used to simplify expressions that involve exponentials, logarithms, rational functions, and square roots:
var('x') # Logs f(x) = log(x^2 * sin(x) / sqrt(1 + x)) print("Original function:") f.show() print("This form is easier to work with:") show(f.expand_log()) print("Simplify expanded form:") show(f.expand_log().simplify_log()) # Rational functions f(x) = (x + 1) / (x^2 + x) print("Original function:") f.show() print("Simplified:") show(f.simplify_rational()) # Radicals f(x) = sqrt(x^2+x)/sqrt(x) print("Original function:") f.show() print("Simplified:") show(f.simplify_radical())
The output is shown in the following screenshot: