I’d follow an issue there, or look into how you can add the appropriate methods yourself.
The derivative should of cdf(dist, g(x)) with respect to x should of course be pdf(dist, g(x))*g'(x), so I’d expect it to be pretty straightforward to support Distributions.jl.

Do you want an answer to the specific code you posted?

Do you want some algorithm that takes many derivatives of the sort you posted?

Or do you want to get SymEngine.jl to support Distributions.jl?

Other?

I don’t know the implementation details of SymEngine, but if it is “3.”, I would start by looking here:

If it is “2.”, I would just drop the dependency on Distributions, and use SpecialFunctions instead. Eg, the cdf of a normal distribution is just (1+erf((x-mu)/sigma*sqrt(2)))/2.

This could also work for “2”, depending on the algorithm, but definitely in case of “1”, it’d probably be easier to just apply the chain rule. Ie, you can find the derivative of

d = diff(1/SP*log(PTB/(K*PTB))+SP/2,PTB)
@assert d == diff(1/SP*log(PTB/(K*PTB))-SP/2,PTB)

Thanks for your reply. I was wondering if SymEngine enables symbolic integration, if that it does, then I can hand code pdf and use symbolic integration to create cdf.