I have a simple question regarding this code:
Maximize[{Integrate[1/(10 - e)
Integrate[((x - 5)/(10 - 5))^(9)*5/x, {x, 5, y}]
, {y, e, 10}], e >= 0, e <= 10}, e]
I get the following error message: "Unable to prove that integration limits {10,e} are real. Adding assumptions may help." I tried some things already mentioned in other questions, but I didn't get it to work. Any tips?
Answer
Adding Assumptions -> y > 0
in the outer-most integral gives
Maximize[{Integrate[1/(10 - e)
Integrate[((x - 5)/(10 - 5))^(9)*5/x, {x, 5, y}]
, {y, e, 10}, Assumptions -> y > 0], 0 <= e <= 10}, e] // Simplify
{1879/504 - Log[32], {e -> 0}}
N @ %
{0.262439, {e -> 0.}}
although with warnings:
Integrate::pwrl: "Unable to prove that integration limits {10,e} are real. Adding assumptions may help.
and
Maximize::wksol: Warning: there is no maximum in the region in which the objective function is defined and the constraints are satisfied; a result on the boundary will be returned.
Let's investigate the procedure step by step:
First, compute the inner integral
f[y_] = Normal[Integrate[(((x - 5)/(10 - 5))^9*5)/x, {x, 5, y}]]
Without Normal
, it's a ConditionalExpression
with y>0
. So, taking it into account in the outer integral:
g[e_] = Integrate[f[y]/
(10 - e), {y, e, 10}, Assumptions -> y > 0 && 0 < e < 10]
where without 0 < e < 10
it is also a ConditionalExpression
with this condition.
For visual inspection
Plot[g[e], {e, 0, 10}]
hence the maximum might indeed be at e = 0
(or e = 10
), but g[0]
yields Indeterminate
(g[10]
yields ComplexInfinity
), so
Limit[g[e], e -> 0]
Limit[g[e], e -> 10]
1879/504 - 5 Log[2]
1879/504 - 5 Log[2]
So the function does not have a local maximum in 0 < e < 10
; it reaches its (finite) maximal values only asymptotically at the boundaries of the interval.
So, wrapping it up, this
Maximize[{Integrate[1/(10 - e)
Integrate[((x - 5)/(10 - 5))^(9)*5/x, {x, 5, y}]
, {y, e, 10}, Assumptions -> y > 0 && 0 < e < 10],
0 <= e <= 10}, e] // Simplify
gives the proper answer, with a warning due to the limit. Constraining e
to 9 <= e <= 10
in the last expression confirms that at e->0
and e->10
the expression yields the same value.
Additionally,
Minimize[{Integrate[1/(10 - e)
Integrate[((x - 5)/(10 - 5))^(9)*5/x, {x, 5, y}]
, {y, e, 10}, Assumptions -> y > 0 && 0 < e < 10],
0 <= e <= 10}, e] // N
{0.0156124, {e -> 1.76903}}
without warnings (without N
the output is a complicated and uninsightful Root
expression).
Comments
Post a Comment