3
$\begingroup$

The known conditions are:

Sin[2 α + β] == 
 2 Sin[β], 0 < α < π/2, 0 < β < π/2

Find the maximum value of Tan [β]

Maximize[{Tan[β], Sin[2 α + β] == 2 Sin[β], 
   0 < α < π/2, 0 < β < π/2, 
   0 < α + β < π}, {α, β}] // FullSimplify

Solve[{TrigFactor[
   SubtractSides[Sin[2 α + β]] == 2 Sin[β]], 
  0 < α < π/2, 0 < β < π/2, 
  0 < α + β < π}, α]

There were no results using the above methods or steps.

$\endgroup$
5
  • 2
    $\begingroup$ Solve for $\beta$ in terms of $\alpha$ and then find the value of $\alpha$ that maximizies $\tan(\beta)$. Plotting the known condition as a contour plot will give you the range of possible values for $\beta$ and give you another approach to find the maximum of $\tan(\beta)$ which I think is $\tan \left(\frac{\sqrt{3}}{3}\right)$. $\endgroup$
    – JimB
    May 18, 2023 at 23:22
  • 1
    $\begingroup$ Sqrt[3]/3 .= 0.57735 is the maximum of Tan[β],but I don't how to use MMA to get this. $\endgroup$
    – cvgmt
    May 19, 2023 at 2:43
  • $\begingroup$ Oops! Thanks, @cvgmt. You are correct. I mistakenly put in the maximum in $\tan$ rather than the associated value of $\beta$. $\endgroup$
    – JimB
    May 19, 2023 at 3:44
  • $\begingroup$ The syntax TrigFactor[SubtractSides[Sin[2 α + β]] == 2 Sin[β]] returns a syntax error (and I'm not sure what you're actually trying to do with it, so I don't know how to correct it.) $\endgroup$ May 19, 2023 at 17:19
  • $\begingroup$ @MichaelSeifert Find the relationship between these two angles $\endgroup$
    – csn899
    May 20, 2023 at 1:02

5 Answers 5

3
$\begingroup$

use NMaximize

NMaximize[{Tan[β], Sin[2 α + β] == 2 Sin[β], 0 < α < π/2 && 0 < β < π/2 && 
   0 < α + β < π}, {α, β}]
{0.57735, {\[Alpha] -> 0.523599, \[Beta] -> 0.523599}}

If the exact result is absolutely necessary, then one can build on the numerical result:

Maximize[{Tan[β], Sin[2 α + β] == 2 Sin[β], 4/10 < α < 6/10 && 
   4/10 < β < 6/10}, {α, β}]
{1/Sqrt[3], {α -> π/6, β -> π/6}}

supplement

This expression works. Please don't ask me why.

Maximize[{Tan[β], Sin[2 α + β] == 2 Sin[β], 0 < α < π/2 && 
    0 < β < π/2}, {α, β}] // Simplify
{1/Sqrt[3], {β -> π/6, α -> π/6}}

Calculation in the traditional way:

f = Tan[β];
g = Sin[2 α + β] - 2 Sin[β];
L = f + λ g;
sol = First @ Solve[{Grad[L, {α, β}] == 0 && g == 0 && 0 < α < π/2 && 0 < β < π/2 && 0 < α + β < π}, {α, β}, {λ}]
{α -> π/6, β -> π/6}

 f /. sol
1/Sqrt[3]

It seems Maximize is buggy.

$\endgroup$
7
  • $\begingroup$ This method is also very good, it can calculate the maximum value. But it's best to calculate the exact value of its maximum value! $\endgroup$
    – csn899
    May 20, 2023 at 0:59
  • $\begingroup$ 4/10 < α < 6/10 && 4/10 < β < 6/10How did these two ranges come from? $\endgroup$
    – csn899
    May 22, 2023 at 0:09
  • $\begingroup$ As already mentioned, from the numerical calculation. $\endgroup$
    – rmw
    May 22, 2023 at 8:34
  • $\begingroup$ Maximize[{Tan[\[Beta]], And[Sin[2 \[Alpha] + \[Beta]] == 2 Sin[\[Beta]], 0 < \[Alpha] < \[Pi]/2, 0 < \[Beta] < \[Pi]/2]}, {\[Alpha], \[Beta]}] // FullSimplify $\endgroup$
    – csn899
    May 22, 2023 at 21:46
  • $\begingroup$ Maximize[{Tan[\[Beta]], Sin[2 \[Alpha] + \[Beta]] == 2 Sin[\[Beta]] && 0 < \[Alpha] < \[Pi]/2 && 0 < \[Beta] < \[Pi]/2}, {\[Alpha], \[Beta]}] // FullSimplify $\endgroup$
    – csn899
    May 22, 2023 at 21:46
6
$\begingroup$

A contour plot of the condition shows that $\beta$ will need to be between 0 and around 0.5:

ContourPlot[Sin[2 α + β] == 2 Sin[β], {α, 0, π/2}, {β, 0, π/2},
  FrameLabel -> (Style[#, Bold, 24, Italic] &) /@ {"α", "β"}]

Contour plot of condition

We can solve for $\beta$ in terms of $\alpha$:

(sol = Simplify[Solve[Sin[2 α + β] == 2 Sin[β], β], 
  Assumptions -> 0 < α < π/2]) // TableForm

Solutions for beta in terms of alpha

Now plot $\beta$ over the values of $\alpha$ for each of the 4 solutions to find legitimate solutions:

Plot[β /. #, {α, 0, π/2}, Frame -> True,
  FrameLabel -> (Style[#, Bold, 18, Italic] &) /@ {"α", "β"}] & /@ sol

Plot of solutions for beta given legitimate alpha values

We see that only the second solution results in the required values for $\beta$.

Maximize[{Tan[β], 0 < α < π/2} /. sol[[2]], α]
(* {1/Sqrt[3], {α -> π/6}} *)

And so the value of $\beta$ that maximizes $\tan(\beta)$ given the equality condition is

β /. sol[[2]] /. α -> π/6
(* {π/6} *)
$\endgroup$
3
$\begingroup$

Update 2

Using a custom DisplayFunction we can display the three-way relation between α, β and Tan[β] in a single ContourPlot with multiple vertical axes (displayFunction and options2 defined below):

ContourPlot[Sin[2 α + β] == 2 Sin[β], {α, 0, π/2}, {β, 0, π/2}, 
 DisplayFunction -> displayFunction, Evaluate @ options2]

enter image description here


displayFunction:

displayFunction = Show[#, Graphics[{ColorData[97] @ 2,
  Cases[Normal @ #, Line[x_] :> 
   {PointSize[Large], Line[{#, Tan@#2} & @@@ x],
    ColorData[97]@1, Point@MaximalBy[Last]@x,
    Dashed,
    Arrowheads[{{.01, 0,                 
      Graphics[{Text[Style[π/6, 14], Offset[{-10, 0}, {0, 0}], {1, 0}]}]}}], 
    Arrow[{{0, 1} #, #} &@First[MaximalBy[Last]@x]],
    ColorData[97]@2, 
    Point@{#, Tan@#2} & @@@ MaximalBy[Tan@*Last]@x,
    Arrowheads[{{.01, 1, 
      Graphics[{Text[Style[1/√3, 14], Offset[{10, 0}, {0, 0}], {-1, 0}]}]}}], 
    Arrow[{{#, Tan@#2}, {π/2, Tan@#2}} & @@ First[MaximalBy[Tan @* Last]@x]]},
    All]}]] &;

options2:

options2 = {
   FrameStyle -> {ColorData[97] /@ {1, 2}, Automatic}, 
   PlotPoints -> 100,
   PlotRange -> {{0, Pi/2}, {0, .8}},
   PlotRangeClipping -> False,
   FrameLabel -> {Style[#, 18] & /@ {"β", "tan(β)"}, {Style["α", 18], None}},
   FrameTicksStyle -> FontSize -> 14,
   FrameTicks -> {
     {Charting`ScaledTicks[{Identity, Identity}, 
         "TicksLength" -> {.03, .015}][##, 6] &, 
      Charting`ScaledTicks[{Tan, ArcTan}, 
         "TicksLength" -> {.03, .015}][##, 6] &},
      {{0, π/6, π/2}, Automatic}},
   GridLines -> {{Pi/6}, None}, 
   ImageSize -> Large};

Update 1

cp = ContourPlot[Sin[2 α + β] == 2 Sin[β], {α, 0, π/2}, {β, 0, π/2}];

For a visual analysis, we can construct a BSplineFunction using the coordinates of the contour line in cp:

BSF = First @ Cases[Normal @ cp, Line[x_] :> BSplineFunction[x], All];

We can use BSF with ParametricPlot3D to display α, β and Tan[β] on the three axes:

ParametricPlot3D[{#, #2, v Tan@#2} & @@ BSF[t], {t, 0, 1}, {v, 0, 1}, 
  BoxRatios -> 1, Mesh -> None, 
  BoundaryStyle -> Directive[Thick, Red], 
  AxesLabel -> (Style[#, 16] & /@ {"α", "β", Tan@β}),
  ImageSize -> Large, Lighting -> "Neutral", ViewPoint -> {2, -2, 1.5}]

enter image description here

We can also use BSF with ParametricPlot to display the relations between α, β and Tan[β] in a 4-panel plot with shared axes (see below for the definitions of legends and options):

Legended[#, legends] & @
 ParametricPlot[{BSF[t],
   {-Tan[t π/2 ], t π/2  },
   {-Tan[t π/2 ], -Tan[t π/2 ]  },
   {#, -Tan @ #2} & @@ BSF[t]},
  {t, 0, 1},
  Evaluate @ options]

enter image description here


Legends:

labels = {Sin[2 α + β] == 2 Sin[β],
   Tan @ β,
   Defer[Tan @ β == Tan @ β],
   Sin[2 α + Tan@β] == 2 Sin[Tan@β]};

legends = MapThread[Placed[LineLegend[#, #2, LabelStyle -> 16], #3] &]@
   {List /@ ColorData[97] /@ Range[4],
    List /@ labels, 
    {{.75, .95}, {.1, .95}, {.15, .05}, {.75, .05}}};

Axis annotations:

ClearAll[axisAnnotations]

axisAnnotations[{lbl1_, lbl2_}] := Arrowheads[{{-Large, 0}, {Large, 1},
    Sequence @@ MapThread[{Small, #2 /. -1 -> 0, 
      Graphics[{Text[#, Offset[{#2 10, 0}, {0, 0}], {-#2, 0}]}]} &, 
       {{lbl1, lbl2}, {-1, 1}}]}];

axesstyle = {axisAnnotations[Style[#, 14] & /@ {"tan(β)", "α"}], 
  axisAnnotations[Style[Rotate[#, -Pi/2], 14] & /@ {"tan(β)", "β"}]};

Ticks:

ClearAll[framed]
framed = Framed[ #, Background -> White, FrameStyle -> None] &;

ticks = {{{-π/2, π/2}, {-1/Sqrt[3], framed[1/Sqrt[3]]}, 
    0, {π/6, framed[π/6]}, π/2}, 
  {{-π/2, π/2}, {-1/Sqrt[3], framed[1/Sqrt[3]]}, {π/6, framed[π/6]}, π/2}};

Prolog:

prolog = {Arrowheads[{{.025, .85}}], Dashed,
   Arrow @ Partition[{{π/6, π/6}, 
      {-1/Sqrt[3], π/6},
      {-1/Sqrt[3], -1/Sqrt[3]},
      {π/6, -1/Sqrt[3]}}, 2, 1, 1],
    Gray, Arrow /@
    (Partition[{{##}, 
       {-Tan@#2, #2}, {-Tan@#2, -Tan@#2}, {#, -Tan@#2}} & @@ 
       BSF[#], 2, 1, 1] & /@ {.15, .75})};

Options:

options = {RegionFunction -> (-π/3 <= # < π/2 &),
   MeshFunctions -> {# &}, Mesh -> {{π/6}},
   MeshStyle -> Directive[Red, PointSize@Large], 
   ImagePadding -> 60,
   GridLines -> {{-1/Sqrt[3], π/6}, {π/6, -1/Sqrt[3]}}, 
   PlotRange -> {{-π/3, π/2}, {-π/3, π/3}},
   AxesOrigin -> {0, 0}, 
   AxesStyle -> (Directive[AbsoluteThickness[2], #] & /@ axesstyle),
   PlotRangePadding -> Scaled[.08],
   Prolog -> prolog,
   Ticks -> ticks,
   TicksStyle -> 12, 
   ImageSize -> 700};

Original answer

Tan @ b is monotonic over 0 < b < π/2 as can be verified using FullSimplify or FunctionMonotonicity

FullSimplify[0 < Tan' @ b , 0 <= b < π / 2]
True
FunctionMonotonicity[{Tan @ b, 0 <= b < π / 2}, b]
1

Thus, we can replace Tan @ b with b in the first argument of Maximize[...] in OP to get an exact (and fast) result:

FullSimplify @
 Maximize[{b, 
   And[Sin[2 a + b] == 2 Sin[b], 0 < a < π/2, 0 < b < π/2, 
    0 < a + b < π]}, {a, b}]
 {π/6, {a -> π/6, b -> π/6}}

Then, simply take the Tan of the first argument of the solution

Tan[First @ %]
1/Sqrt[3]
$\endgroup$
12
  • $\begingroup$ FullSimplify @ Maximize[{b, And[Sin[2 a + b] == 2 Sin[b], 0 < a < π/2, 0 < b < π/2, 0 < a + b < π]}, {a, b}]Why is And connected in the middle of this sentence? $\endgroup$
    – csn899
    May 22, 2023 at 0:15
  • $\begingroup$ @csn899, ti works the same with or without using And to wrap all constraints. (I had a separate line defining constraints with constraints = And[....] and copy/pasted its rhs into Maximize[{b, ...},...] to save a line when I posted) $\endgroup$
    – kglr
    May 22, 2023 at 1:44
  • $\begingroup$ Maximize[{\[Beta], 2 Sin[\[Beta]] == Sin[2 \[Alpha] + \[Beta]], 0 < \[Alpha] < \[Pi]/2, 0 < \[Beta] < \[Pi]/2, 0 < \[Alpha] + \[Beta] < \[Pi]}, {\[Alpha], \[Beta]}] // \ FullSimplifyWhy can't we get the correct result for this? $\endgroup$
    – csn899
    May 22, 2023 at 4:27
  • $\begingroup$ @csn899, interesting -- And[...] is needed after all and FullSimplify works in myterious ways. $\endgroup$
    – kglr
    May 22, 2023 at 4:39
  • $\begingroup$ What is the real difference between And? $\endgroup$
    – csn899
    May 22, 2023 at 4:43
2
$\begingroup$

Any algebraic equation in trigonometrics with integer multiples transformes into an algebraic equation by the stereographic projection

  t<->tan phi/2

In this case

the hopefully correct transform

      Maximize[{y, (2 x + y)/(1 + (2 x + y)^2) == (4 y)/(1 + y^2), 
       0 <= {x, y} <= 1}, y, Reals] /. 
               {x -> Tan[\[Alpha]/2],  y -> Tan[\[Beta]/2]}

results

       {\[Piecewise] -Root[3 #1^3+2 Tan[\[Alpha]/2]-14 #1^2
      Tan[\[Alpha]/2]+#1 (3+16 Tan[\[Alpha]/2]^2)&,1] 
             0<=Tan[\[Alpha]/2]<=1


      -\[Infinity]    True

      ,{Tan[\[Beta]/2]->\[Piecewise]  -Root[3 #1^3+2
Tan[\[Alpha]/2]-14 #1^2 Tan[\[Alpha]/2]+#1 
  (3+16 Tan[\[Alpha]/2]^2)&,1]    0<=Tan[\[Alpha]/2]<=1 


 Indeterminate    True

No comment, verification left to the reader.

$\endgroup$
3
  • $\begingroup$ How did these replace with x and y? $\endgroup$
    – csn899
    May 20, 2023 at 1:04
  • $\begingroup$ The easiest and obviously failsafe way is, to not change the names of the variables. Mathematicians get headaches about this way, because it only works with twosided double bookkeeping. This is the central point of all calculus and algorithmical mappings: In practice local variables are not kept in different name spaces. The old school of Euler, Lagrange and Jacobi generally used Latin and Greek characters or a tick. Both technics are not Mathematica style , one because 26 characters are a too small set, the other, Wolfram did not differentiate between superscript and Power but had an y' $\endgroup$
    – Roland F
    May 20, 2023 at 4:23
  • $\begingroup$ A right idea, but badly realized. The true way is 2 Cos[\[Alpha]] Cos[\[Beta]] Sin[\[Alpha]] + Cos[\[Alpha]]^2 Sin[\[Beta]] - Sin[\[Alpha]]^2 Sin[\[Beta]] == 2 Sin[\[Beta]] /. {Sin[\[Alpha]] -> 2 x/(1 + x^2), Cos[\[Alpha]] -> (1 - x^2)/(1 + x^2), Sin[\[Beta]] -> 2 y/(1 + y^2), Cos[\[Beta]] -> (1 - y^2)/(1 + y^2)} and then Maximize[{2 y/(1 - y^2), -((8 x^2 y)/((1 + x^2)^2 (1 + y^2))) + ( 2 (1 - x^2)^2 y)/((1 + x^2)^2 (1 + y^2)) + ( 4 x (1 - x^2) (1 - y^2))/((1 + x^2)^2 (1 + y^2)) == (4 y)/( 1 + y^2), 0 <= {x, y}}, {x, y}]. $\endgroup$
    – user64494
    Jun 16, 2023 at 18:10
0
$\begingroup$

Making use of TrigExpand, this can be done in 13.2.1 on Windows 10 in such a way.

Maximize[{Tan[\[Beta]], TrigExpand[Sin[2 \[Alpha] + \[Beta]] == 2 Sin[\[Beta]]], 
  0 <= \[Alpha] <= \[Pi]/2, 0 <= \[Beta] <= \[Pi]/2}, {\[Alpha], \[Beta]}]

{1/Sqrt[3], {\[Beta] -> \[Pi]/6, \[Alpha] -> \[Pi]/6}}

and a warning

Maximize::ztest: Unable to decide whether numeric quantities {-5 [Pi]-24 ArcTan[Root[1+Times[<<2>>]+Times[<<2>>]+Times[<<2>>]+Power[<<2>>]&,1,0]],7 [Pi]-24 ArcTan[Root[1+Times[<<2>>]+Times[<<2>>]+Times[<<2>>]+Power[<<2>>]&,3,0]],-11 [Pi]-24 <<1>>,[Pi]-24 ArcTan[Root[1+Times[<<2>>]+Times[<<2>>]+Times[<<2>>]+Power[<<2>>]&,3,0]],Sqrt[3]-3 Tan[4 ArcTan[Root[<<1>>&,3,0]]]} are equal to zero. Assuming they are.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.