1

i want to print the output of the equation in latex format (Output of the latex code), when i try to compile the following code , it is giving me the latex coede . can i print the latex equation i python?

import sympy
from sympy import *
t = symbols('t')
a = symbols('a')
b = symbols('b')
c = symbols('c')
L= Function('x')

deq = Eq(diff(L(t),t),a*L(t)+ b + c/L(t)) 
Lsoln = dsolve(deq, L(t))
pprint(Lsoln)    
print(latex(Lsoln))
buran
  • 13,682
  • 10
  • 36
  • 61
Mahesh
  • 13
  • 5
  • Please consider from importy sympy to L=Function('x') are part of the code at the beginning – Mahesh Sep 20 '22 at 18:04
  • If you are using Jupyter Notebook, than you can execute `init_printing()` just after `from sympy import *`. After that, you can write `Lsoln` on a cell, execute it, and it will render the latex representation on the screen. – Davide_sd Sep 20 '22 at 20:37
  • i dont know the reason why iam not able to post any questions on stackoverflow. – Mahesh Sep 24 '22 at 16:45

0 Answers0