Axel Vogt

5821 Reputation

20 Badges

20 years, 221 days
Munich, Bavaria, Germany

MaplePrimes Activity


These are answers submitted by Axel Vogt

For example

singular(1/sin(x)/cos(x),x) or singular(1/sin(x+cos(Pi*x)),x);

 

n:='n';
integrand:=(2*x^n+1)/(x^(n+1)+x);
int(integrand,x); simplify(%) assuming 0<n;

giving ln(x) + ln(x^n + 1)/n

Do you really mean that or numerical zero (may be after "fnormal") ?

I get a solution -ln(inf^3*r + (6*I*r*t - r^3 - 2*eps^3)*inf + 2*eps^3*r) +
ln(-(-inf + r)*(-2*eps^3 + inf^2*r + inf*r^2)*exp(exp(-r^2/2)/4) + 6*I*inf*r*t)

which would do it numerical feeding your values (after "fnormal"), but that
boils down to exp(-r^2/2)/4 for eps --> 0, inf --> infinity

 

You can try gfun, an external package

with(gfun):
-4*RootOf(_Z^3 - 3*_Z^2 - 10*_Z - 1)^2 +
19*RootOf(_Z^3 - 3*_Z^2 - 10*_Z - 1) + 3:
algfuntoalgeq(%, y(x));


                     3       2             
                    y  + 50 y  + 75 y - 125

https://perso.ens-lyon.fr/bruno.salvy/software/the-gfun-package/

Re(...)=0, Im(...)=0 helps, for example see the attached file, x = u + v*I

MP_235618.mw

sols = {u[1] = 0., u[2] = 0., u[3] = 0., u[4] = 0., u[5] = 0.,
  v[1] = -1.40967543044154,
  v[2] = 0.372048922420580,
  v[3] = -1.40967543044154,
  v[4] = 0.628572434471089,
  v[5] = 0.499261752811266}

One can "always" plot the inverse function without computing it - just as the reflection at the diagonal:

# https://www.mapleprimes.com/questions/235504-Cannot-Plot-Erf-Function

plot(erf, -3 .. 3):
p1:=%: # remember the plot

# reflect the plot at the diagonal, i.e. the line through (x,y) = (0,0) and (1,1)
plottools[reflect](p1, [[0,0], [1,1]]);
p2:=%:

 

 

Download MP_35504_plot_inverse_function.mw

I think the problem comes through "erf" for large inputs. You may try the following at the beginning of your sheet Negativity_(v13_beta_gamma_mu):

local erf; #erf(0.1);
cut:=5.8;
erf:= t -> piecewise(t<-cut,-1, t<= cut, :-erf(t), cut <t, 1);
#erf(0.1), erf(30.1), erf(-40.1);

 

You need a formula, which is not implemented (though Maple knows that it is true ...)

Maple Worksheet - Error

Failed to load the worksheet /maplenet/convert/MP_235246.mws .

Download MP_235246.mws

Look up the help, do not use the option "view"


 

# https://www.mapleprimes.com/questions/235156-Can-We-Find-The-Maximum-Value-Of-This

restart;

expr:=sin(sqrt(3)*t)*cos(sqrt(3)*t)*(sqrt(3)*cos(sqrt(3)*t) - sin(sqrt(3)*t))/3;

(1/3)*sin(3^(1/2)*t)*cos(3^(1/2)*t)*(3^(1/2)*cos(3^(1/2)*t)-sin(3^(1/2)*t))

(1)

t_max := '((-arctan(sqrt(RootOf(_Z^3 - 16*_Z^2 + 16*_Z - 3, index = 2))) + Pi))/sqrt(3)'; evalf(%);

(-arctan(sqrt(RootOf(_Z^3-16*_Z^2+16*_Z-3, index = 2)))+Pi)/sqrt(3)

 

1.39084587051934

(2)

'0=diff(expr,t)': 'eval(%, t =t_max)';
normal(%):
convert(%, radical):
evala(%);

eval(0 = diff(expr, t), t = t_max)

 

0 = 0

(3)

# for a compact presentation use an "alias"
R = RootOf(_Z^3 - 16*_Z^2 + 16*_Z - 3, index = 2);
alias(%):
't_max'=t_max;
'eval(expr, t =t_max)': '%'= simplify(%);

R = RootOf(_Z^3-16*_Z^2+16*_Z-3, index = 2)

 

t_max = (1/3)*(-arctan(R^(1/2))+Pi)*3^(1/2)

 

eval(expr, t = t_max) = (1/3)*(3^(1/2)*R^(1/2)+R)/(1+R)^(3/2)

(4)

# just in case one dislikes the sqrt
't_max = ((-arctan(RootOf(_Z^6 - 16*_Z^4 + 16*_Z^2 - 3, index = 2)) + Pi))/sqrt(3)';
convert(%, radical): evala(%): is(%); # true

t_max = (-arctan(RootOf(_Z^6-16*_Z^4+16*_Z^2-3, index = 2))+Pi)/sqrt(3)

 

true

(5)

 

I only post the result since my sheet is too cruddy.

Download MP_235156.mw

 

Plotting the rhs lets one guess a singularity in 0 and MultiSeries-series lets me substitute A = B^9 (or even better: A=1/B^9). Then fsolve works (I used simplify assuming positive before that)

It is always a good idea to plot and from that one sees that you run into "numerical singularities". I used afa:=0.277 for the following

plot(X, 0 .. Pi/2); #shows a problem at x towards Pi/2 (using your X modified for T2)

tmp:=eval(sin(x)*T2, x=Pi/2-0.001):    #example

plot(log10(tmp), y=-Pi/6+afa..Pi/6);   #indicates a reason for that

plot(log10(tmp), y=-Pi/128 .. Pi/128); # locates it even more
plot(log10(tmp), y=0.016 .. 0.016005);

For the x-y plane you can guess the trouble for x ~ Pi/2 and y ~ 0 using

'sin(x)*T2';
plot3d(%, x=0 .. Pi/2, y=-Pi/6+afa ..Pi/6, axes=boxed);

'sin(x)*T2'; log10('%');
plot3d(%, x=0 .. Pi/2, y=-0.05 ..0.05, axes=boxed);

'sin(x)*T2'; log10('%');
plot3d(%, x=Pi/2 - 0.05 .. Pi/2.0, y=-0.05 ..0.05, axes=boxed);


I do not have a good idea for that, so you may switch to the rough estimate shown by vv in his contribution. But I wonder how Mathematica treats that peaks and how reliable the result (you forgot to mention it) may be

 

It is a bug I would say. But the package for integral transformations knows it

# https://www.mapleprimes.com/questions/234913-Int-Gives-Wrong-Answer-For-Improper-Integral

restart: #interface(version);

with(inttrans):
#? inttrans # help about this package

J:=Int(sin(x)*exp(-2*I*Pi*f*x)/x, x = -infinity .. infinity); # upper case Pi

Int(sin(x)*exp(-(2*I)*Pi*f*x)/x, x = -infinity .. infinity)

(1)

fourier(F(x),x,t); convert(%, Int);
eval(%, F= 'x->sin(x)/x'): eval(%, t=2*Pi*f); # to see what we need as input

fourier(F(x), x, t)

 

Int(F(x)*exp(-I*x*t), x = -infinity .. infinity)

 

Int(sin(x)*exp(-(2*I)*Pi*f*x)/x, x = -infinity .. infinity)

(2)

# one has to tell Maple what it should take for Heaviside(0) to write it "piecewise"
# here Heaviside(0) = 1 gives the desired (!) result
# try  Heaviside(0) = 0 as well for fun ...

NumericEventHandler(invalid_operation = `Heaviside/EventHandler`(value_at_zero = 1)):

#fourier(sin(x)/x,x,t); eval(%, t=2*Pi*f);
fourier(sin(x)/x,x,2*Pi*f);  
convert(%, piecewise, f); # note: that implicitly assumes f to be real

Pi*(-Heaviside(f-1/(2*Pi))+Heaviside(f+1/(2*Pi)))

 

piecewise(f < -(1/2)/Pi, 0, f < (1/2)/Pi, Pi, (1/2)/Pi <= f, 0)

(3)

 

Download MP_234913.mw

I get 3.515*10^18 (4 leading decimals) within ~ 20 sec by interchanging the integration

Digits:=15;

X:=proc(xx)
local f;
f:=unapply(subs(x=xx, sin(x)*T1), y);
evalf(Int(f,-Pi/6..-Pi/6+afa, epsilon=1e-5, method = _d01ajc));
end proc;

evalf(k*Int(X, 0..Pi/2, method = _d01akc, epsilon = 1e-4));

The problem might stem from oscillations towards Pi/2

MP_234881_text_program.mw

Use upper case Matrix, not the old style lower case matrix.

1 2 3 4 5 6 7 Last Page 3 of 92