Python | sympy.solve() method Last Updated : 12 Jun, 2019 Summarize Comments Improve Suggest changes Share Like Article Like Report With the help of sympy.solve(expression) method, we can solve the mathematical equations easily and it will return the roots of the equation that is provided as parameter using sympy.solve() method. Syntax : sympy.solve(expression) Return : Return the roots of the equation. Example #1 : In this example we can see that by using sympy.solve() method, we can solve the mathematical expressions and this will return the roots of that equation. Python3 1=1 # import sympy from sympy import * x, y = symbols('x y') gfg_exp = x**2 - 4 print("Before Integration : {}".format(gfg_exp)) # Use sympy.integrate() method intr = solve(gfg_exp, x) print("After Integration : {}".format(intr)) Output : Before Integration : x**2 - 4 After Integration : [-2, 2] Example #2 : Python3 1=1 # import sympy from sympy import * x, y = symbols('x y') gfg_exp = x**2 + 36 print("Before Integration : {}".format(gfg_exp)) # Use sympy.integrate() method intr = solve(gfg_exp, x) print("After Integration : {}".format(intr)) Output : Before Integration : x**2 + 36 After Integration : [-6*I, 6*I] Comment More infoAdvertise with us Next Article Python sympy.subs() method J jitender_1998 Follow Improve Article Tags : Python SymPy Practice Tags : python Similar Reads Python | sympy.sec() method With the help of sympy.sec() method, we are able to find the value of sec theta using sympy.sec() function. Syntax : sympy.sec() Return : Return value of sec theta. Example #1 : In this example we can see that by using sympy.sec() method, we can find the value of sec theta. Python3 1=1 # import symp 1 min read Python | sympy.S() method With the help of sympy.S() method, we can make a single instance of an object by using sympy.S() method, where S denotes to singleton class. Syntax : sympy.S() Return : Return the single instance of an object. Example #1 : In this example we can see that by using sympy.S() method, we are able to cre 1 min read Python | sympy.sin() method In sympy, the sin() method is a sine function. Using the sin(x) method in the sympy module, we can compute the sine of x. Syntax : sympy.sin(x) Return : Returns the sine of x Code #1: Below is the example using the sin() method to find the sine function. Python3 # importing sympy library from sympy 1 min read Python | sympy.symbols() method With the help of sympy.symbols() method, we can declare some variables for the use of mathematical expression and polynomials by using sympy.symbols() method. Syntax : sympy.symbols() Return : Return nothing or None. Example #1 : In this example we can see that by using sympy.symbols() method, we ar 1 min read Python sympy.subs() method sympy.subs() method in Python is used to substitute a variable or expression with a specified value or another expression in a symbolic mathematical expression. It is part of the SymPy library, which provides functionality for symbolic mathematics in Python, allowing you to work with equations, poly 3 min read Python | sympy.sqrt() method With the help of sympy.sqrt() method, we can find the square root of any number by using sympy.sqrt() method. Syntax : sympy.sqrt(number) Return : Return square root of any number. Example #1 : In this example we can see that by using sympy.sqrt() method, we can get the square root of any number. Py 1 min read Like