This chapter covers solving unconstrained and constrained optimization problems with differential calculus and SymPy, identifying potential pitfalls. SciPy is also introduced to solve unconstrained optimization problems, in single and multiple dimensions, numerically, with a few lines of code. The chapter goes on to solve linear programming in SciPy and PuLP.