I have the following optimization problem involving symbolic polynomials: I want to define two polynomials A(x) and B(x) (of fixed degree, say d), and let P(x) be a polynomial such that P''(x) = A(x)^2 + B(x)^2. We also require P(0) = P'(0) = 0 so that P is uniquely determined by A and B. I want to optimize the coefficients of A and B to minimize a function f(P), where (for instance) f(P) = (coefficient of x^3 in P)^2 - | (coefficient of x^2 in P) - 1 |. Here I used a specific f for the example, but I am interesting in something more general (which may involve the coefficients of P, or P(a) for some fixed a, etc.). So I tried using sympy to define A and B, but then if I try using cvxpy to minimize, it's not compatible. So what package(s) should I use in Python ? Thank you ! Continue reading...