from sympy import *
init_session()
IPython console for SymPy 1.0 (Python 3.5.2-64-bit) (ground types: python) These commands were executed: >>> from __future__ import division >>> from sympy import * >>> x, y, z, t = symbols('x y z t') >>> k, m, n = symbols('k m n', integer=True) >>> f, g, h = symbols('f g h', cls=Function) >>> init_printing() Documentation can be found at http://docs.sympy.org/1.0/
r, theta, phi, kappa, alpha = symbols('r theta phi kappa alpha')
R, Theta = symbols('R Theta', cls=Function)
u = f(r, theta)
eq = 1/r**2*diff(r**2*u.diff(r), r) + 1/(r**2*sin(theta))*diff(sin(theta)*u.diff(theta), theta) + kappa**2*u
aux = expand(r**2*eq.subs(f(r, theta), R(r)*Theta(theta)).doit()/(R(r)*Theta(theta)))
aux
eq1 = Theta(theta).diff(theta, 2) + cos(theta)/sin(theta)*Theta(theta).diff(theta) - alpha**2*Theta(theta)
eq1
eq2 = expand(aux - eq1/Theta(theta))
eq2 = expand(eq2*R(r))
eq2
print(eq2)
alpha**2*R(r) + kappa**2*r**2*R(r) + r**2*Derivative(R(r), r, r) + 2*r*Derivative(R(r), r)