Message Boards Message Boards

0
|
4233 Views
|
3 Replies
|
2 Total Likes
View groups...
Share
Share this post:

Plot and show that the following function has a kink at t = 4?

Posted 5 years ago

Hello! I am quite new to Mathematica and I am sorry of this is a silly question. I have this function (g is what I care about):

f = x (1 - x) Log[1 - t x (1 - x)]
g = N[Abs[Integrate[f, {x, 0, 1}]]^2, 5]

Which I have to plot and show it has a kink at t = 4. I tried to use:

Plot[f,{t,1,8}]

But I get the plot only up to 4. I tried to look at some values and I used:

Table[g, {t, 4.2, 8, 0.2}]

And it seems I get "Undefined" for each value. However, when I actually replaced t with 4.2 in the definition of f, and asked for g, I got a finite value. Can someone explain to me what's wrong (I am not sure if the kink at 4 will be infinite, but even if it is, why don't I get any value for numbers greater than 4). Thank you!

POSTED BY: Silviu Udrescu
3 Replies
Posted 5 years ago
ClearAll[x, t]
f = x (1 - x) Log[1 - t x (1 - x)]
int = Integrate[f, {x, 0, 1}, Assumptions -> t \[Element] Reals]

Gives

ConditionalExpression[1/18 (-5 - 12/t + (6 Sqrt[-4 + t] (2 + t) ArcTanh[1/Sqrt[(-4 + t)/t]])/t^(3/2)), 
         0 < t < 4 || t < 0]

Integral is only defined for 0 < t < 4 || t < 0

Plot[int^2, {t, -10, 10}]

enter image description here

POSTED BY: Rohit Namjoshi
Posted 5 years ago

Thank you for your reply. However I tried:

f = x (1 - x) Log[1 - 5 x (1 - x)]
g = N[Abs[Integrate[f, {x, 0, 1}]]^2, 5]
g

So I replace t with 5 explicitly, and I got the result 0.20399 and I am confused. Why do I get a defined, finite and pretty reasonable value when I plug the t directly (I tried other values greater than 4, too and it works), but for the plotting it is not working?

POSTED BY: Silviu Udrescu

But in your original code, you evaluate the integral with a generic t and Integrate returns an answer with conditions on t. In other words, Integrate fails to find a fully general solution.

I'd use this:

Clear[g];
g[t0_] := Block[{t = t0}, Abs[NIntegrate[f, {x, 0, 1}]]^2];
POSTED BY: Michael Rogers
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract