The difference is very small. Both mean "not simple". So it means there are alot of parts, and details. But "complicated" means challenging, difficult to understand. "Complex" is closer to "highly evolved".
In short, complicated is negative, complex is neither negative nor positive.
This Mathematics problem is very complex. Its too complicated for a beginner.