Python | sympy.rewrite() method
With the help of sympy.rewrite() method, we can represent any mathematical function in terms of another function.
expression – It is mathematical expression which is to be represented by another function.
function – It is the mathematical function used to rewrite the given expression.
Returns: Returns a mathematical expression corresponding to the input in terms of specified function.
Expression = tan(x) Expression in terms of sin() : 2*sin(x)**2/sin(2*x)
Expression = factorial(x) Expression in terms of gamma() : gamma(x + 1)
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course. And to begin with your Machine Learning Journey, join the Machine Learning – Basic Level Course