MATLAB: How to determine the upper limit of an indefinite integral given a lower limit and the integrated result

boundfindintegrallimitmathMATLABsymbolicupper

How to determine the upper limit of an indefinite integral given a lower limit and the integrated result? 
I want to find the unknown upper limit value, x, when the below integrated expression is equal to 1. 
>> syms h g x C
>> h = 1.0545718E-34
>> g = 5.344285879E-28
>> C = 1/sqrt(2.*pi)
>> y = (C - (exp(2.*g.*i.*x./h)).*(C - cos(x).*((h.^2)./2) + (g.*x)/2.*h.*i));
>> z = (C - (exp(-2.*g.*i.*x./h)).*(C - cos(x).*((h.^2)./2) + (g.*x)/2.*h.*-i));
>> out = int(y.*z,0, (2.*pi)./x)
How can I determine x for which out = 1? 

Best Answer

You may be able to compute the upper limit as follows:
1) Compute the indefinite integral of the expression y.*z
>> syms x
>> h = 1.0545718E-34;
>> g = 5.344285879E-28;
>> C = 1/sqrt(2.*pi);
>> y = (C - (exp(2.*g.*i.*x./h)).*(C - cos(x).*((h.^2)./2) + (g.*x)/2.*h.*i));
>> z = (C - (exp(-2.*g.*i.*x./h)).*(C - cos(x).*((h.^2)./2) + (g.*x)/2.*h.*-i));
>> out = int(y.*z);
This returns a symbolic expression 'out' as a function of x
2) Write this as an equation which we would like to solve:
>> eqn = out == 1;
3) The value of out in the lower bound (0) is 0 which can be verified by
>> subs(out,0)
Therefore, we can solve for the upper bound as follows:
>> solx = solve(eqn,x)
>> x = (2*pi)/solx;
4) Verify the output:
>> out1 = int(y.*z,0,(2.*pi)./x);
>> double(out1)
ans =
1