consider the following function
α = 1/Sqrt[(1 - η^2)^2 + 4 D0^2 η^2];
p1 = Plot[{Evaluate[Table[α, {D0, 0, 1, .1}]], 1/(1 + η^2)}, {η, 0, 2},
PlotRange -> {{0, 2}, {0, 3}}]
i now wanted to calculate the function that goes through all the maxima of this function for $\eta \in(0,1)$.
Using
MaxValue[α, D0]
gives
while
Maximize[α, D0]
yields
which are both not what I'm looking for. Using the straight forward approach
max = α /. Solve[D[α, η] == 0]
p2 = Plot[max[[1]], {η, 0, 1}, PlotRange -> {{0, 2}, {0, 3}}]
Show[p1, p2]
it works. I guess i didn't quite get how MaxValue
works. Can someone teach me, what I did wrong?
Maximize[\[Alpha], D0]
. And from the docs ofMaxValue
under Details and Options: "MaxValue[\[Ellipsis]]
is effectively equivalent toFirst[Maximize[\[Ellipsis]]]
." That explains it. $\endgroup$D0
has been given a value somewhere at top-level in notebook. If so, that is source of your trouble. $\endgroup$D0
hasn't been given any value. $\endgroup$