TransWikia.com

Mathematica has detected an internal error

Mathematica Asked by JHT on August 6, 2021

When trying to plot the following function in version 12.2

f[x_]:=x Exp[-x^2]
F[y_]:=NIntegrate[Sign[f[x]]Sqrt[((f[x])^2)/(f[x]+1)],{x,0,y}];
Plot[F[x],{x,-5,5}]

this message appears.

enter image description here

It happens also when using RealSign. Does that occur in other versions as well, or just for me?

It does not occur if I change the definition a little and use f[x_?NumericQ] = x Exp[-x^2].

3 Answers

NumericQ work.

f[x_] = x Exp[-x^2]
F[y_?NumericQ] := 
  NIntegrate[Sign[f[x]] Sqrt[((f[x])^2)/(f[x] + 1)], {x, 0, y}];
Plot[F[x], {x, -5, 5}]

Or

Clear[f, G];
f[x_] = x Exp[-x^2];
NDSolve[{G'[x] == Sign[f[x]] Sqrt[((f[x])^2)/(f[x] + 1)], G[0] == 0}, 
 G[x], {x, -5, 5}]
Plot[G[x] /. %, {x, -5, 5}]

enter image description here

Answered by cvgmt on August 6, 2021

Your code without any change produced: enter image description here

Answered by Konstantin on August 6, 2021

V11.3 , it works and no problem.

enter image description here

Answered by wuyudi on August 6, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP