I have an expression that I think could be simplified somewhat and for some reason sympy is not performing what I think are simple simplifications. My code with the example is as follows:
# coding: utf-8
# In[1]:
from __future__ import division
from sympy import *
init_printing()
# In[3]:
d, R, c = symbols('d R c', Positive = True, Real = True)
Δt = symbols('\Delta_t', Real = True)
# In[4]:
Δt = (1/c**2)*(-R*c+sqrt(c**2*(R+d)**2))
Δt
# In[5]:
simplify(Δt)
I have placed the code above for cut and paste pleasures... The graphical output from iPython is as follows:
I would have expected the final result to be the following:
I thought that based on how I defined the variables the simplifications would have happened, at least the sqrt((R+d)**2)... What am I doing wrong?