Let the polynomial function $f : \Bbb N \to \Bbb N$ be defined by
$$f (M) := 2M^3N + 2M^3 - M^2N^2 - 3M^2N + 2M^2 - MN^3 + MN^2 - 2MN + \frac{N^4}{2} + \frac{N^2}{2}$$
where $N$ is given natural number. I am interested in finding the value (or values) of $M$ that minimizes $f$. Could anyone please provide guidance on how to approach this problem?
Code
I've written a code that calculates the minimum, over $\Bbb N$ and the limit tends to be approximately $0.608$:
import numpy as np
import matplotlib.pyplot as plt
def theory(N):
M = np.arange(1, N)
r = 2 * np.power(M, 3) * N + 2 * np.power(M, 3) - np.power(M, 2) * np.power(N, 2) - 3 * np.power(M, 2) * N + 2 * np.power(M, 2) - M * np.power(N, 3) + M * np.power(N, 2) - 2 * M * N + np.power(N, 4) / 2 + np.power(N, 2) / 2
return M[np.argmin(r)]
if __name__ == '__main__':
N = 200
series_theory = [theory(i)/i for i in range(2, N+1)]
plt.plot(series_theory,'b')
plt.show()