if i have a exponential distribution equation for example, and i want to know the probability of a certain region between x1 and x2, would all i have to do is get the cdf equation, then plugin lambda, then subtract this equation with a x2 value, with the same equation with a x1 value, to get the probability between x1 and x2?

so

and of course i set lamdba.

cdf(x2) - cdf(x1) = probability between x1 and x2?

Does this work with any distribution equation weather discrete or continuous?