3

https://math.stackexchange.com/a/185627

Referring to the methods mentioned in this answer, after trying the first method I got a term that looked like this:

$$\sqrt{14 + 5\sin^2{\theta} + 6\sin{\theta} + 12\cos{\theta}}$$

Which was rather difficult to find a minima of, algebraically.

Using a common method, i.e. the shortest distance of a point from a curve lies along its common normal line.

I ended up with an equation, $$2 \sec{\theta} - 9 \csc{\theta} = 5$$

Which was again rather difficult to solve algebraically.

Can someone please help me solve the above equations, or solve the question with an alternate solution?

RobPratt
  • 45,619
  • You did all that parametric math to get to $x=3+2cos\theta$ and $y=1+3sin\theta$? – NadiKeUssPar Jul 16 '23 at 14:54
  • This was my exact method to obtain the first expression:

    $x=3+2cos{\theta}$ and $y = 1+3sin{\theta}$

    Using the distance formula

    $$\sqrt{(3+2cos^2{theta})^2 + (1+3sin^2{\theta})^2}$$

    $$ = \sqrt{9+4cos^2{\theta} + 12 cos{\theta} + 1 + 9sin^2{\theta} + 6sin{\theta}}$$ $$ = \sqrt{10 + 4cos^2{\theta} + 4sin^2{\theta} + 5sin^2{\theta} + 6sin{\theta} + 12 cos{\theta}}$$

    $$=\sqrt{14 + 5sin^2{\theta} + 6sin{\theta} + 12cos{\theta}}$$

    Also how can we say that for the minimum of $asin{\theta} + bcos{\theta} + c$

    the entire function will attain a minima?

    – Grandmaster10 Jul 16 '23 at 14:56
  • Well yes, you can try a calculus approach to minimize that function $f(\theta)$ – NadiKeUssPar Jul 16 '23 at 15:12
  • 1
    (1/2) You can look at this as problem of minimizing $f(x,y) = x^2+y^2$ with constraint $g(x,y) = \frac{(x-3)^2}{4}+\frac{(y-1)^2}{9}-1 = 0$. This falls down onto territory of Lagrange multiplier. Calculating gradients gives us system $\lambda(x-3) = 4x$, $\lambda(y-1) = 9y$ and eliminating $\lambda$ gives us $y = \frac{4x}{27-5x}$. Substituting that into the constraint $g(x,y) = 0$ will result in a quartic equation $25 x^4 - 420 x^3 + 2510 x^2 - 5940 x + 3969= 0$. – Ennar Jul 16 '23 at 15:30
  • 1
    (2/2) There are two real solutions, $x_1≈1.0727$ and $x_2≈4.3306$, minimum being obtained for $x_1$. The distance from the origin is the square root of $f$ and is $d\approx 1.09091$. You can see that this works from the following plot. – Ennar Jul 16 '23 at 15:31
  • Thank you for this solution. – Grandmaster10 Jul 16 '23 at 15:49
  • You are welcome. I wasn't sure if you'd be satisfied with this, but I can turn it into an answer. – Ennar Jul 16 '23 at 15:56
  • Please refer to the graphical approach from my older post here. – Ng Chung Tak Jul 22 '23 at 00:34

3 Answers3

5

I will copy what I wrote in comments as an answer.

You can look at this as the problem of minimizing $f(x,y) = x^2+y^2$ with constraint $g(x,y) = \frac{(x-3)^2}{4}+\frac{(y-1)^2}{9}-1 = 0$. This falls down onto the territory of Lagrange multiplier. Calculating gradients gives us $\nabla f(x,y) = (2x,2y)$ and $\nabla g(x,y) = \left(\frac 12(x-3), \frac 29(y-1)\right)$ which need to be colinear, so we get system \begin{align} \lambda(x-3) &= 4x\\ \lambda(y-1) &= 9y \end{align} and eliminating $\lambda$ gives us $ y= \frac{4x}{27-5x}$. We can substitute that into the constraint $g(x,y) = 0$ which then simplifies to finding the roots of quartic $25 x^4 - 420 x^3 + 2510 x^2 - 5940 x + 3969$.

In theory, quartics are solvable by radicals, so it's possible to obtain explicit solution, or you can use numerical methods, depending on what you are looking for. For example, you could use Durand–Kerner method.

It turns out that we have two real solutions $x_1≈1.0727$, $x_2≈4.3306$, minimum being obtained by $x_1$, which you can verify from bordered Hessian. In this case, it boils down to calculating determinant of the bordered Hessian.

The value of $f(x,y)$ for $x = x_1$, $y = \frac{4x_1}{27-5x_1}$ is approximately $1.19001$, so the required distance is the square root of that, which is approximately $1.09088$.

You can convice yourself of the correctness of the result by looking at the following plot.

Ennar
  • 23,082
2

Back to your initial formulation, if your goal is to minimize with respect to $\theta$ $$L=\sqrt{14 + 5\sin^2(\theta) + 6\sin(\theta) + 12\cos(\theta)}$$, we need to find the zero of funtion $$f(\theta)=\frac {d(L^2)}{d\theta}=5 \sin (2 \theta )+6 \cos (\theta )-12 \sin (\theta )=0$$ By inspection or graphing, we know that the solution is just above $\pi$.

Expanding as a series $$f(\theta)=\sum_{n=0}^\infty \frac 1 {n!} \Bigg(\left(5\ 2^n+12\right) \sin \left(\frac{\pi n}{2}\right)-6 \cos \left(\frac{\pi n}{2}\right)\Bigg)\,(\theta-\pi)^n$$

Truncating to some order and using power series reversion $$\theta=\pi +\frac{3}{11}-\frac{27}{2662}+\frac{2817}{322102}-\frac{116397}{77948684}+\frac{39120327}{47158953820}+\cdots$$

Using only the above terms $$\theta=\pi +\frac{6382174251}{23579476910}=3.41226$$ while the "exact" solution, as given by Newton method, is $3.41211$.

Using the approximate result then $$L=1.09091077$$ while the "exact" solution is $1.09091065$

Edit

Even simpler : let $\theta=x+\pi$ which gives $$g(x)=12 \sin (x)+5 \sin (2 x)-6 \cos (x)$$ and use the simple $[2,2]$ Padé approximant around $x=0$. This gives $$g(x) \sim \frac {-6+\frac{12809 }{599}x+\frac{3569 }{1198} x^2} {1+\frac{123 }{1198}x+\frac{2731 }{7188}x^2 }$$ whose error is $\sim 2 x^5$.

So, at the price of a simple quadratic $$x \sim \frac{\sqrt{189724453}-12809}{3569} \quad \implies \quad \theta \sim 3.41199$$ which leads to $$L_{\text{min}}=\color{red}{1.090910}72$$

  • Thank you for this solution! Could you please suggest me some resources to learn how to truncate these long Taylor expansions into a desired form. – Grandmaster10 Jul 17 '23 at 05:36
  • @Grandmaster10. When I say truncate, I just mean using a few terms. For example, let $\theta=\pi+x$ and use the classical series for the since and cosine funtions up to a few terms. – Claude Leibovici Jul 17 '23 at 05:55
  • By truncation I meant how did you express ${\theta}$ in terms of x in a linear format, that is the part I am facing some difficulty doing. – Grandmaster10 Jul 17 '23 at 06:09
  • @Grandmaster10. Have a look at https://mathworld.wolfram.com/SeriesReversion.html It is quite simple – Claude Leibovici Jul 17 '23 at 06:20
  • Thank you! Such a simple idea coming from the fact that $f(f^{-1}(x)) = x$ but so useful! – Grandmaster10 Jul 17 '23 at 06:35
0

The Eberly's method ref allows to efficiently project a point onto an ellipse. After translation, we seek to project the point $(U,V)=(-3,-1)$ onto the ellipse defined by $\frac{X^2}{a^2}+\frac{Y^2}{b^2}=1$ where $a=2, b=3$.

We seek the ellipse point $(X,Y)$ where the normal is parallel to $(U-X,V-Y)$ This gives the two equations $$ \left\lbrace \begin{array}{ccc} U-X&=&t\frac{X}{a^2}\\ V-Y&=&t\frac{Y}{b^2} \end{array} \right. $$ for some real $t$. We find $$ X(t)=\frac{a^2 U}{t+a^2}, Y(t)=\frac{b^2 V}{t+b^2} $$ and we must solve (one) root of $ P(t)= \frac{X^2(t)}{a^2}+\frac{Y^2(t)}{b^2}-1 $.

The distance is finally $d= \sqrt{ \left[ U-X(t^*) \right]^2 + \left[ V-Y(t^*)\right]^2} $.

The numerical application gives $t^*=2.226431983483, d=1.0909106524$.

Steph
  • 3,665