I am currently stuck in a problem, where I need to find an analytic expression $x_0=f(\alpha,\beta)$. Let me first try to explain what $x_0$ is:
Let $x$ be a real-valued variable, which must obey the following relation: \begin{equation} x^2 + \left[a_1(\omega) \alpha + a_2(\omega) \beta \right] x + \left[ a_3(\omega) + a_4(\omega) \alpha \beta \right] \leq 0 \end{equation} with $\omega \in [0,\pi]$ and both $\alpha$ and $\beta$ are positive and real-valued. The $a_i(\omega)$ terms are defined as follows: \begin{equation} a_1(\omega) = \frac{4 \left( cos(\omega) - 1\right)}{sin^2(\omega) + 2 \left(\cos(\omega) - 1\right)} \end{equation} \begin{equation} a_2(\omega) = \frac{-8}{cos(2\omega)-1} \end{equation} \begin{equation} a_3(\omega) = \frac{3-cos(\omega)}{cos(\omega)-1} \end{equation} \begin{equation} a_4(\omega) = \frac{-16}{ sin^2(\omega) \left(cos(\omega)-1\right)} \end{equation} The equation for $x$ can be written in terms of \begin{equation} x^2 + p x + q \leq 0 \end{equation} with \begin{equation} p=a_1(\omega)\,\alpha + a_2(\omega)\,\beta \end{equation} \begin{equation} q=a_3(\omega) + a_4(\omega)\,\alpha\,\beta. \end{equation}
If $4 q < p^2$ is true, one can obtain a possible solution for $x$: \begin{equation} \frac{1}{2}\left(-\sqrt{p^2-4q} - p\right) \leq x \leq \frac{1}{2}\left(\sqrt{p^2-4q} - p\right) \end{equation}
Now, I am especially interested in finding the maximum of the upper bound of this solution regarding $\omega$, which I call $x_0(\alpha,\beta)$: \begin{equation} x_0(\alpha,\beta) = \max_{\omega} \frac{1}{2}\left(\sqrt{p^2-4q} - p\right) \end{equation}
To estimate an expression for $x_0(\alpha,\beta)$, I thought I could calculate the first derivative of $(\sqrt{p^2-4q}-p)/2$, setting it zero and solve for $\omega$. This should give me an expression like $\omega_0 = f(\alpha,\beta)$, where $\omega_0$ is the $\omega$-value at which the maximum $x_0$ is located. This expression could then be inserted into $(\sqrt{p^2-4q}-p)/2$ and should result in an expression for $x_0=f(\alpha,\beta)$.
Of course, it should also be checked, if $x_0$ is actually a maximum via the second derivative. However, I checked the shape of $(\sqrt{p^2-4q}-p)/2$ for some $\alpha$ and $\beta$ values I am interested in and it didn't seem to have local minimas in that range.
Basically, my problem is the step, where I want to solve for $\omega$ when setting the first derivative to zero: \begin{equation} \frac{\partial}{\partial \omega} \frac{1}{2}\left(\sqrt{p^2-4q} - p\right) = 0 \end{equation} My problem is, that $\omega$ occurs only in the trigonometric functions in the $a_i(\omega)$-terms. I tried to solve the problem with with a symbolic programming library (sympy), but failed at this point to estimate a solution.
Has anyone a hint for me, how such a problem can be solved or in which direction I could go? Maybe there is some kind of trick I can use to simplify the problem?
Thank you all in advance!
I haven't double checked to make sure there are no typing errors but something like that will do the trick. The main idea was to write a polynomial system in order to compute the Groebner basis in lexicographic order.
EDIT:
The answer was updated because the line
EQN_2 = cancel(2*diff(q,w) + x*diff(p,w))was wrong. The correct assignment isEQN_2 = cancel(diff(q,w) + x*diff(p,w)).Thank you, FloSe, for pointing it out.