MATLAB: Integration with symbolic boundaries

symbolic integration

i have a polynomial in z and would like to integrate w.r.t. z between 0 and (h+d) where h is a known value and d is unknown and therefore symbolic. Is there any function in matlab that would allow me to do this?
here is what i have tried
function [Pa,Za,Pp,Zp,Residual_d,Tie_rod_force] = calculate_thrusts_and_their_locations(Qa,Qp,gamma_b_a,gamma_b_p,h0,h,Cd,Phi_d,Ka,Kp,Z0)
syms d z
AVS = Qa + gamma_b_a*z;
AHS = -2*Cd*sqrt(Ka) + Ka*AVS;
PVS = Qp + gamma_b_p*d;
PHS = 2*Cd*sqrt(Kp) + Kp*PVS;
Pa = INT(AHS,z,Z0,(h+d));
Za = (INT((z*Pa),z,Z0,(h+d)))/Pa;
Pp = INT(PHS,z,0,d);
Zp = (INT((z*Pp),z,0,d))/Pp;
Residual_d = Pa*Za - Pp*Zp;
Tie_rod_force = Pa - Pp;
end
all the inputs of this function are numerical values!

Best Answer

The symbolic toolbox int() should be able to handle that. Of course the values you get out will not necessarily be easily expressed.
Why are you dividing Za by Pa when it is constructed, and dividing Zp by Pp when that is constructed, but then multiplying by those factors again when calculating the Residual_d ?