In [1]:
import sympy as sp
sp.init_printing()

In [13]:
x, y, k = sp.symbols('x y k')
f = sp.Function('f')

In [6]:
sp.Integral(f(x), x)


Out[6]:
$$\int f{\left (x \right )}\, dx$$

In [7]:
sp.Derivative(f(x), x)


Out[7]:
$$\frac{d}{d x} f{\left (x \right )}$$

In [8]:
sp.diff(f(x),x)


Out[8]:
$$\frac{d}{d x} f{\left (x \right )}$$

In [9]:
sp.diff(x**2, x)


Out[9]:
$$2 x$$

In [14]:
sp.dsolve(sp.diff(f(x)) - k*f(x), f(x))


Out[14]:
$$f{\left (x \right )} = C_{1} e^{k x}$$

In [25]:
sol = sp.dsolve(sp.Derivative(f(x),x) - k*f(x), f(x));
sol


Out[25]:
$$f{\left (x \right )} = C_{1} e^{k x}$$

In [33]:
const_sol = sol.subs(x,0).subs(f(0),1);
const_sol


Out[33]:
$$1 = C_{1}$$

In [40]:
sol.subs(const_sol.args[1], const_sol.args[0])


Out[40]:
$$f{\left (x \right )} = e^{k x}$$

In [ ]: