MATLAB: How to check if symbolic expression is positive

greater than zerosimplifysimplify expressionsymbolic

First question; sorry for etiquette violations in advance. I have a very long, complicated expression in five symbolic variables. Each variable is strictly positive. I want to know whether the expression is definitely positive or definitely negative. I've factorised it and eliminated the (definitely positive) denominator to reduce the expression, and I've retried
simplify()
simplifyFraction()
But it's still very convoluted. I'm not sure what else to try, or how to incorporate the assumptions on the symbolic variables.
The variables (all >0) are:
u1, u2, J12, J13, J23
EDIT: Here is a MWE, incorporating @Star Strider's answer using isAlways:
clear;
syms u1 u2 u3;
syms J12 J13 J23
assume(J12>3*u1)
assume(J12>3*u2)
assume(J23>3*u1)
assume(J23>3*u2)
assume(J13>=J12)
assume(J13>=J23)
assume(u2>0)
assume(u1>=u2)
assume(u1,'real')
assume(u2,'real')
assume(J12,'real')
assume(J13,'real')
assume(J23,'real')
f = exp(u1 - (J12*exp(u2 - J23*(u2/(2*J23) + 1/2)))/(exp(u1 + J12*(u2/(2*J23) - 1/2) - J13*(u2/(2*J23) + 1/2)) + exp(u2 - J23*(u2/(2*J23) + 1/2)) + exp(J23*(u2/(2*J23) - 1/2))) - (J13*exp(J23*(u2/(2*J23) - 1/2)))/(exp(u1 + J12*(u2/(2*J23) - 1/2) - J13*(u2/(2*J23) + 1/2)) + exp(u2 - J23*(u2/(2*J23) + 1/2)) + exp(J23*(u2/(2*J23) - 1/2))))/(exp(u2 - (J23*exp(J23*(u2/(2*J23) - 1/2)))/(exp(u1 + J12*(u2/(2*J23) - 1/2) - J13*(u2/(2*J23) + 1/2)) + exp(u2 - J23*(u2/(2*J23) + 1/2)) + exp(J23*(u2/(2*J23) - 1/2))) - (J12*exp(u1 + J12*(u2/(2*J23) - 1/2) - J13*(u2/(2*J23) + 1/2)))/(exp(u1 + J12*(u2/(2*J23) - 1/2) - J13*(u2/(2*J23) + 1/2)) + exp(u2 - J23*(u2/(2*J23) + 1/2)) + exp(J23*(u2/(2*J23) - 1/2)))) + exp(- (J23*exp(u2 - J23*(u2/(2*J23) + 1/2)))/(exp(u1 + J12*(u2/(2*J23) - 1/2) - J13*(u2/(2*J23) + 1/2)) + exp(u2 - J23*(u2/(2*J23) + 1/2)) + exp(J23*(u2/(2*J23) - 1/2))) - (J13*exp(u1 + J12*(u2/(2*J23) - 1/2) - J13*(u2/(2*J23) + 1/2)))/(exp(u1 + J12*(u2/(2*J23) - 1/2) - J13*(u2/(2*J23) + 1/2)) + exp(u2 - J23*(u2/(2*J23) + 1/2)) + exp(J23*(u2/(2*J23) - 1/2)))) + exp(u1 - (J12*exp(u2 - J23*(u2/(2*J23) + 1/2)))/(exp(u1 + J12*(u2/(2*J23) - 1/2) - J13*(u2/(2*J23) + 1/2)) + exp(u2 - J23*(u2/(2*J23) + 1/2)) + exp(J23*(u2/(2*J23) - 1/2))) - (J13*exp(J23*(u2/(2*J23) - 1/2)))/(exp(u1 + J12*(u2/(2*J23) - 1/2) - J13*(u2/(2*J23) + 1/2)) + exp(u2 - J23*(u2/(2*J23) + 1/2)) + exp(J23*(u2/(2*J23) - 1/2))))) - exp(u1 + J12*(u2/(2*J23) - 1/2) - J13*(u2/(2*J23) + 1/2))/(exp(u1 + J12*(u2/(2*J23) - 1/2) - J13*(u2/(2*J23) + 1/2)) + exp(u2 - J23*(u2/(2*J23) + 1/2)) + exp(J23*(u2/(2*J23) - 1/2)));
isAlways(f<=0)
f = factor(f);
[N,D] = numden(f);
f = simplify(N, 'Steps', 50);
isAlways(f<=0)
isAlways(D>0)

Best Answer

Use the isAlways (link) function.
Since you have your complete code and we do not, I will defer to you to evaluate it.
Related Question