# Easily solved equation isn't being solved by 'solve'

1 view (last 30 days)
Oscar McMullin on 29 May 2020
Edited: David Goodmanson on 29 May 2020
When using the function solve in matlab, I keep on having this returned:
minb =
Empty sym: 0-by-1
Yet when using a piece of paper to solve analytically for b, using the expression supplied by matlab, fmin == 0, I can very quickly find the value of b in terms of the other variables. Furthermore, when I solve for h2m, it solves it, and solves it correctly. Why is this happening?
Thank you very much.
syms x A alpha h2m
syms b positive rational
psi = A*exp(-(b*x^2));
V = alpha*x^4;
H = -h2m*diff(diff(psi)) + V*psi;
Hall = psi*H;
avgE=int(Hall,x,-inf,inf);
pretty(simplify(Hall))
pretty(simplify(avgE))
fmin = diff(avgE,b);
pretty(simplify(fmin));
eqn = (fmin == 0);
minb = solve(eqn,b)

Stephan on 29 May 2020
There are 3 solutions, which you will find by setting the 'ReturnConditions' option to true:
syms x A alpha h2m
syms b positive rational
psi = A*exp(-(b*x^2));
V = alpha*x^4;
H = -h2m*diff(diff(psi)) + V*psi;
Hall = psi*H;
avgE=int(Hall,x,-inf,inf);
pretty(simplify(Hall))
pretty(simplify(avgE))
fmin = diff(avgE,b);
pretty(simplify(fmin));
eqn = (fmin == 0);
minb = solve(eqn,b ,'ReturnConditions',true);
minb.conditions
minb.b
results are:
ans =
0 < (- 1 + 3^(1/2)*1i)^2*((15*alpha)/(16*h2m))^(1/3) & in(((3^(1/2)*1i)/2 - 1/2)^2*((15*alpha)/(16*h2m))^(1/3), 'rational') & A ~= 0 & ((~0 < (1 + 3^(1/2)*1i)^2*((15*alpha)/(16*h2m))^(1/3) & (signIm(((3^(1/2)*1i)/2 - 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == 1 & signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == 1 | signIm(((3^(1/2)*1i)/2 - 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == 1 & signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == -1 & signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) ~= 1 | signIm(((3^(1/2)*1i)/2 - 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == -1 & signIm(((3^(1/2)*1i)/2 - 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) ~= 1 & (signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == -1 | signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == 1)) | signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) ~= -1 & signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) ~= 1 & (signIm(((3^(1/2)*1i)/2 - 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == -1 | signIm(((3^(1/2)*1i)/2 - 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == 1)) & ~0 < alpha/h2m | ~in(((15*alpha)/(16*h2m))^(1/3), 'rational') & (~0 < (1 + 3^(1/2)*1i)^2*((15*alpha)/(16*h2m))^(1/3) & (signIm(((3^(1/2)*1i)/2 - 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == 1 & signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == 1 | signIm(((3^(1/2)*1i)/2 - 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == 1 & signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == -1 & signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) ~= 1 | signIm(((3^(1/2)*1i)/2 - 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == -1 & signIm(((3^(1/2)*1i)/2 - 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) ~= 1 & (signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == -1 | signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == 1)) | signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) ~= -1 & signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) ~= 1 & (signIm(((3^(1/2)*1i)/2 - 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == -1 | signIm(((3^(1/2)*1i)/2 - 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == 1)) & 0 < alpha/h2m | 0 < (1 + 3^(1/2)*1i)^2*((15*alpha)/(16*h2m))^(1/3) & ~in(((3^(1/2)*1i)/2 + 1/2)^2*((15*alpha)/(16*h2m))^(1/3), 'rational') & (~in(((15*alpha)/(16*h2m))^(1/3), 'rational') | ~0 < alpha/h2m) & (signIm(((3^(1/2)*1i)/2 - 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == 1 & signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == 1 | signIm(((3^(1/2)*1i)/2 - 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == 1 & signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == -1 & signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) ~= 1 | signIm(((3^(1/2)*1i)/2 - 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == -1 & signIm(((3^(1/2)*1i)/2 - 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) ~= 1 & (signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == -1 | signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == 1))) | 0 < (- 1 + 3^(1/2)*1i)^2*((15*alpha)/(16*h2m))^(1/3) & in(((3^(1/2)*1i)/2 - 1/2)^2*((15*alpha)/(16*h2m))^(1/3), 'rational') & in(((15*alpha)/(16*h2m))^(1/3), 'rational') & A ~= 0 & 0 < alpha/h2m & (~0 < (1 + 3^(1/2)*1i)^2*((15*alpha)/(16*h2m))^(1/3) & (signIm(((3^(1/2)*1i)/2 - 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == 1 & signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == 1 | signIm(((3^(1/2)*1i)/2 - 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == 1 & signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == -1 & signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) ~= 1 | signIm(((3^(1/2)*1i)/2 - 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == -1 & signIm(((3^(1/2)*1i)/2 - 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) ~= 1 & (signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == -1 | signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == 1)) | 0 < (1 + 3^(1/2)*1i)^2*((15*alpha)/(16*h2m))^(1/3) & ~in(((3^(1/2)*1i)/2 + 1/2)^2*((15*alpha)/(16*h2m))^(1/3), 'rational') & (signIm(((3^(1/2)*1i)/2 - 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == 1 & signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == 1 | signIm(((3^(1/2)*1i)/2 - 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == 1 & signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == -1 & signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) ~= 1 | signIm(((3^(1/2)*1i)/2 - 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == -1 & signIm(((3^(1/2)*1i)/2 - 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) ~= 1 & (signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == -1 | signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == 1)) | signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) ~= -1 & signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) ~= 1 & (signIm(((3^(1/2)*1i)/2 - 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == -1 | signIm(((3^(1/2)*1i)/2 - 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == 1)) | 0 < (- 1 + 3^(1/2)*1i)^2*((15*alpha)/(16*h2m))^(1/3) & 0 < (1 + 3^(1/2)*1i)^2*((15*alpha)/(16*h2m))^(1/3) & in(((3^(1/2)*1i)/2 - 1/2)^2*((15*alpha)/(16*h2m))^(1/3), 'rational') & in(((3^(1/2)*1i)/2 + 1/2)^2*((15*alpha)/(16*h2m))^(1/3), 'rational') & (~in(((15*alpha)/(16*h2m))^(1/3), 'rational') | ~0 < alpha/h2m) & A ~= 0 & (signIm(((3^(1/2)*1i)/2 - 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == 1 & signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == 1 | signIm(((3^(1/2)*1i)/2 - 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == 1 & signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == -1 & signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) ~= 1 | signIm(((3^(1/2)*1i)/2 - 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == -1 & signIm(((3^(1/2)*1i)/2 - 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) ~= 1 & (signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == -1 | signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == 1)) | 0 < (- 1 + 3^(1/2)*1i)^2*((15*alpha)/(16*h2m))^(1/3) & 0 < (1 + 3^(1/2)*1i)^2*((15*alpha)/(16*h2m))^(1/3) & in(((3^(1/2)*1i)/2 - 1/2)^2*((15*alpha)/(16*h2m))^(1/3), 'rational') & in(((3^(1/2)*1i)/2 + 1/2)^2*((15*alpha)/(16*h2m))^(1/3), 'rational') & in(((15*alpha)/(16*h2m))^(1/3), 'rational') & A ~= 0 & 0 < alpha/h2m & (signIm(((3^(1/2)*1i)/2 - 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == 1 & signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == 1 | signIm(((3^(1/2)*1i)/2 - 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == 1 & signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == -1 & signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) ~= 1 | signIm(((3^(1/2)*1i)/2 - 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == -1 & signIm(((3^(1/2)*1i)/2 - 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) ~= 1 & (signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == -1 | signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == 1))
0 < (1 + 3^(1/2)*1i)^2*((15*alpha)/(16*h2m))^(1/3) & in(((3^(1/2)*1i)/2 + 1/2)^2*((15*alpha)/(16*h2m))^(1/3), 'rational') & A ~= 0 & ((~0 < (- 1 + 3^(1/2)*1i)^2*((15*alpha)/(16*h2m))^(1/3) & (signIm(((3^(1/2)*1i)/2 - 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == 1 & signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == 1 | signIm(((3^(1/2)*1i)/2 - 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == 1 & signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == -1 & signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) ~= 1 | signIm(((3^(1/2)*1i)/2 - 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == -1 & signIm(((3^(1/2)*1i)/2 - 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) ~= 1 & (signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == -1 | signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == 1)) | signIm(((3^(1/2)*1i)/2 - 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) ~= -1 & signIm(((3^(1/2)*1i)/2 - 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) ~= 1 & (signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == -1 | signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == 1)) & ~0 < alpha/h2m | ~in(((15*alpha)/(16*h2m))^(1/3), 'rational') & (~0 < (- 1 + 3^(1/2)*1i)^2*((15*alpha)/(16*h2m))^(1/3) & (signIm(((3^(1/2)*1i)/2 - 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == 1 & signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == 1 | signIm(((3^(1/2)*1i)/2 - 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == 1 & signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == -1 & signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) ~= 1 | signIm(((3^(1/2)*1i)/2 - 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == -1 & signIm(((3^(1/2)*1i)/2 - 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) ~= 1 & (signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == -1 | signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == 1)) | signIm(((3^(1/2)*1i)/2 - 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) ~= -1 & signIm(((3^(1/2)*1i)/2 - 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) ~= 1 & (signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == -1 | signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == 1)) & 0 < alpha/h2m | 0 < (- 1 + 3^(1/2)*1i)^2*((15*alpha)/(16*h2m))^(1/3) & ~in(((3^(1/2)*1i)/2 - 1/2)^2*((15*alpha)/(16*h2m))^(1/3), 'rational') & (~in(((15*alpha)/(16*h2m))^(1/3), 'rational') | ~0 < alpha/h2m) & (signIm(((3^(1/2)*1i)/2 - 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == 1 & signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == 1 | signIm(((3^(1/2)*1i)/2 - 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == 1 & signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == -1 & signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) ~= 1 | signIm(((3^(1/2)*1i)/2 - 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == -1 & signIm(((3^(1/2)*1i)/2 - 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) ~= 1 & (signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == -1 | signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == 1))) | 0 < (1 + 3^(1/2)*1i)^2*((15*alpha)/(16*h2m))^(1/3) & in(((3^(1/2)*1i)/2 + 1/2)^2*((15*alpha)/(16*h2m))^(1/3), 'rational') & in(((15*alpha)/(16*h2m))^(1/3), 'rational') & A ~= 0 & 0 < alpha/h2m & (~0 < (- 1 + 3^(1/2)*1i)^2*((15*alpha)/(16*h2m))^(1/3) & (signIm(((3^(1/2)*1i)/2 - 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == 1 & signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == 1 | signIm(((3^(1/2)*1i)/2 - 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == 1 & signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == -1 & signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) ~= 1 | signIm(((3^(1/2)*1i)/2 - 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == -1 & signIm(((3^(1/2)*1i)/2 - 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) ~= 1 & (signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == -1 | signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == 1)) | 0 < (- 1 + 3^(1/2)*1i)^2*((15*alpha)/(16*h2m))^(1/3) & ~in(((3^(1/2)*1i)/2 - 1/2)^2*((15*alpha)/(16*h2m))^(1/3), 'rational') & (signIm(((3^(1/2)*1i)/2 - 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == 1 & signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == 1 | signIm(((3^(1/2)*1i)/2 - 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == 1 & signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == -1 & signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) ~= 1 | signIm(((3^(1/2)*1i)/2 - 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == -1 & signIm(((3^(1/2)*1i)/2 - 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) ~= 1 & (signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == -1 | signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == 1)) | signIm(((3^(1/2)*1i)/2 - 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) ~= -1 & signIm(((3^(1/2)*1i)/2 - 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) ~= 1 & (signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == -1 | signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == 1)) | 0 < (- 1 + 3^(1/2)*1i)^2*((15*alpha)/(16*h2m))^(1/3) & 0 < (1 + 3^(1/2)*1i)^2*((15*alpha)/(16*h2m))^(1/3) & in(((3^(1/2)*1i)/2 - 1/2)^2*((15*alpha)/(16*h2m))^(1/3), 'rational') & in(((3^(1/2)*1i)/2 + 1/2)^2*((15*alpha)/(16*h2m))^(1/3), 'rational') & (~in(((15*alpha)/(16*h2m))^(1/3), 'rational') | ~0 < alpha/h2m) & A ~= 0 & (signIm(((3^(1/2)*1i)/2 - 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == 1 & signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == 1 | signIm(((3^(1/2)*1i)/2 - 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == 1 & signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == -1 & signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) ~= 1 | signIm(((3^(1/2)*1i)/2 - 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == -1 & signIm(((3^(1/2)*1i)/2 - 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) ~= 1 & (signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == -1 | signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == 1)) | 0 < (- 1 + 3^(1/2)*1i)^2*((15*alpha)/(16*h2m))^(1/3) & 0 < (1 + 3^(1/2)*1i)^2*((15*alpha)/(16*h2m))^(1/3) & in(((3^(1/2)*1i)/2 - 1/2)^2*((15*alpha)/(16*h2m))^(1/3), 'rational') & in(((3^(1/2)*1i)/2 + 1/2)^2*((15*alpha)/(16*h2m))^(1/3), 'rational') & in(((15*alpha)/(16*h2m))^(1/3), 'rational') & A ~= 0 & 0 < alpha/h2m & (signIm(((3^(1/2)*1i)/2 - 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == 1 & signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == 1 | signIm(((3^(1/2)*1i)/2 - 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == 1 & signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == -1 & signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) ~= 1 | signIm(((3^(1/2)*1i)/2 - 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == -1 & signIm(((3^(1/2)*1i)/2 - 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) ~= 1 & (signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == -1 | signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == 1))
in(((15*alpha)/(16*h2m))^(1/3), 'rational') & A ~= 0 & 0 < alpha/h2m & (0 < (- 1 + 3^(1/2)*1i)^2*((15*alpha)/(16*h2m))^(1/3) & ~in(((3^(1/2)*1i)/2 - 1/2)^2*((15*alpha)/(16*h2m))^(1/3), 'rational') & (~0 < (1 + 3^(1/2)*1i)^2*((15*alpha)/(16*h2m))^(1/3) & (signIm(((3^(1/2)*1i)/2 - 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == 1 & signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == 1 | signIm(((3^(1/2)*1i)/2 - 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == 1 & signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == -1 & signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) ~= 1 | signIm(((3^(1/2)*1i)/2 - 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == -1 & signIm(((3^(1/2)*1i)/2 - 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) ~= 1 & (signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == -1 | signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == 1)) | 0 < (1 + 3^(1/2)*1i)^2*((15*alpha)/(16*h2m))^(1/3) & ~in(((3^(1/2)*1i)/2 + 1/2)^2*((15*alpha)/(16*h2m))^(1/3), 'rational') & (signIm(((3^(1/2)*1i)/2 - 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == 1 & signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == 1 | signIm(((3^(1/2)*1i)/2 - 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == 1 & signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == -1 & signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) ~= 1 | signIm(((3^(1/2)*1i)/2 - 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == -1 & signIm(((3^(1/2)*1i)/2 - 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) ~= 1 & (signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == -1 | signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == 1)) | signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) ~= -1 & signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) ~= 1 & (signIm(((3^(1/2)*1i)/2 - 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == -1 | signIm(((3^(1/2)*1i)/2 - 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == 1)) | ~0 < (- 1 + 3^(1/2)*1i)^2*((15*alpha)/(16*h2m))^(1/3) & ~0 < (1 + 3^(1/2)*1i)^2*((15*alpha)/(16*h2m))^(1/3) & (signIm(((3^(1/2)*1i)/2 - 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == 1 & signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == 1 | signIm(((3^(1/2)*1i)/2 - 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == 1 & signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == -1 & signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) ~= 1 | signIm(((3^(1/2)*1i)/2 - 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == -1 & signIm(((3^(1/2)*1i)/2 - 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) ~= 1 & (signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == -1 | signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == 1)) | 0 < (1 + 3^(1/2)*1i)^2*((15*alpha)/(16*h2m))^(1/3) & ~in(((3^(1/2)*1i)/2 + 1/2)^2*((15*alpha)/(16*h2m))^(1/3), 'rational') & (~0 < (- 1 + 3^(1/2)*1i)^2*((15*alpha)/(16*h2m))^(1/3) & (signIm(((3^(1/2)*1i)/2 - 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == 1 & signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == 1 | signIm(((3^(1/2)*1i)/2 - 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == 1 & signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == -1 & signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) ~= 1 | signIm(((3^(1/2)*1i)/2 - 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == -1 & signIm(((3^(1/2)*1i)/2 - 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) ~= 1 & (signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == -1 | signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == 1)) | signIm(((3^(1/2)*1i)/2 - 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) ~= -1 & signIm(((3^(1/2)*1i)/2 - 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) ~= 1 & (signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == -1 | signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == 1)) | ~0 < (- 1 + 3^(1/2)*1i)^2*((15*alpha)/(16*h2m))^(1/3) & signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) ~= -1 & signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) ~= 1 & (signIm(((3^(1/2)*1i)/2 - 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == -1 | signIm(((3^(1/2)*1i)/2 - 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == 1) | ~0 < (1 + 3^(1/2)*1i)^2*((15*alpha)/(16*h2m))^(1/3) & signIm(((3^(1/2)*1i)/2 - 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) ~= -1 & signIm(((3^(1/2)*1i)/2 - 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) ~= 1 & (signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == -1 | signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == 1) | signIm(((3^(1/2)*1i)/2 - 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) ~= -1 & signIm(((3^(1/2)*1i)/2 - 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) ~= 1 & signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) ~= -1 & signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) ~= 1) | 0 < (- 1 + 3^(1/2)*1i)^2*((15*alpha)/(16*h2m))^(1/3) & in(((3^(1/2)*1i)/2 - 1/2)^2*((15*alpha)/(16*h2m))^(1/3), 'rational') & in(((15*alpha)/(16*h2m))^(1/3), 'rational') & A ~= 0 & 0 < alpha/h2m & (~0 < (1 + 3^(1/2)*1i)^2*((15*alpha)/(16*h2m))^(1/3) & (signIm(((3^(1/2)*1i)/2 - 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == 1 & signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == 1 | signIm(((3^(1/2)*1i)/2 - 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == 1 & signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == -1 & signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) ~= 1 | signIm(((3^(1/2)*1i)/2 - 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == -1 & signIm(((3^(1/2)*1i)/2 - 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) ~= 1 & (signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == -1 | signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == 1)) | 0 < (1 + 3^(1/2)*1i)^2*((15*alpha)/(16*h2m))^(1/3) & ~in(((3^(1/2)*1i)/2 + 1/2)^2*((15*alpha)/(16*h2m))^(1/3), 'rational') & (signIm(((3^(1/2)*1i)/2 - 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == 1 & signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == 1 | signIm(((3^(1/2)*1i)/2 - 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == 1 & signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == -1 & signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) ~= 1 | signIm(((3^(1/2)*1i)/2 - 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == -1 & signIm(((3^(1/2)*1i)/2 - 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) ~= 1 & (signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == -1 | signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == 1)) | signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) ~= -1 & signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) ~= 1 & (signIm(((3^(1/2)*1i)/2 - 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == -1 | signIm(((3^(1/2)*1i)/2 - 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == 1)) | 0 < (1 + 3^(1/2)*1i)^2*((15*alpha)/(16*h2m))^(1/3) & in(((3^(1/2)*1i)/2 + 1/2)^2*((15*alpha)/(16*h2m))^(1/3), 'rational') & in(((15*alpha)/(16*h2m))^(1/3), 'rational') & A ~= 0 & 0 < alpha/h2m & (~0 < (- 1 + 3^(1/2)*1i)^2*((15*alpha)/(16*h2m))^(1/3) & (signIm(((3^(1/2)*1i)/2 - 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == 1 & signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == 1 | signIm(((3^(1/2)*1i)/2 - 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == 1 & signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == -1 & signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) ~= 1 | signIm(((3^(1/2)*1i)/2 - 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == -1 & signIm(((3^(1/2)*1i)/2 - 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) ~= 1 & (signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == -1 | signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == 1)) | 0 < (- 1 + 3^(1/2)*1i)^2*((15*alpha)/(16*h2m))^(1/3) & ~in(((3^(1/2)*1i)/2 - 1/2)^2*((15*alpha)/(16*h2m))^(1/3), 'rational') & (signIm(((3^(1/2)*1i)/2 - 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == 1 & signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == 1 | signIm(((3^(1/2)*1i)/2 - 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == 1 & signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == -1 & signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) ~= 1 | signIm(((3^(1/2)*1i)/2 - 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == -1 & signIm(((3^(1/2)*1i)/2 - 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) ~= 1 & (signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == -1 | signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == 1)) | signIm(((3^(1/2)*1i)/2 - 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) ~= -1 & signIm(((3^(1/2)*1i)/2 - 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) ~= 1 & (signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == -1 | signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == 1)) | 0 < (- 1 + 3^(1/2)*1i)^2*((15*alpha)/(16*h2m))^(1/3) & 0 < (1 + 3^(1/2)*1i)^2*((15*alpha)/(16*h2m))^(1/3) & in(((3^(1/2)*1i)/2 - 1/2)^2*((15*alpha)/(16*h2m))^(1/3), 'rational') & in(((3^(1/2)*1i)/2 + 1/2)^2*((15*alpha)/(16*h2m))^(1/3), 'rational') & in(((15*alpha)/(16*h2m))^(1/3), 'rational') & A ~= 0 & 0 < alpha/h2m & (signIm(((3^(1/2)*1i)/2 - 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == 1 & signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == 1 | signIm(((3^(1/2)*1i)/2 - 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == 1 & signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == -1 & signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) ~= 1 | signIm(((3^(1/2)*1i)/2 - 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == -1 & signIm(((3^(1/2)*1i)/2 - 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) ~= 1 & (signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == -1 | signIm(((3^(1/2)*1i)/2 + 1/2)*((15*alpha)/(16*h2m))^(1/6)*1i) == 1))
ans =
((3^(1/2)*1i)/2 - 1/2)^2*((15*alpha)/(16*h2m))^(1/3)
((3^(1/2)*1i)/2 + 1/2)^2*((15*alpha)/(16*h2m))^(1/3)
((15*alpha)/(16*h2m))^(1/3)

Oscar McMullin on 29 May 2020
Ahhh wonderful, the last one is the answer I got when I solved for it analytically. Thank you very much!
David Goodmanson on 29 May 2020
Hi Oscar,
this is a good solution to the equation you asked about, but I don't believe it is the right solution to the problem. You want to minimize integral(psi* H psi) dx for normalized psi, which is the same thing as minimizing
<H> = integral(psi* H psi)dx / integral(psi* psi)dx.
For psi = exp(-b x^2),
kinetic_energy = -h2m d2psi/dx^2 = -h2m (-2b + 4b^2x^2) exp(-b x^2)
as you can check. The following code takes a look at <H>, the function to be minimized.
h2m = 1;
alpha = 1;
b0 = ((15/16)*alpha/h2m)^(1/3); % slightly rewritten
b = b0;
psi2 = @(x) exp(-2*b*x.^2); % psi squared
psiHpsi = @(x) (-h2m*(-2*b + 4*b^2*x.^2) + alpha*x.^4).*psi2(x);
E = integral(psiHpsi,-inf,inf)/integral(psi2,-inf,inf)
E = 1.1745
which is great until you try the same thing with
b = b0 -.1
E = 1.1215
b= b0 - .2
E = 1.0879
so the b0 you have does not correspond to the minimum energy. The actual minimum occurs at
b1 = ((3/8)*alpha/h2m)^(1/3);
E = 1.0817
b = b1 + .01
E = 1.0819
b = b1 - .01
E = 1.0819
What might have happened is that in your derivation you did not take normalization into account.