A limiting factor to the exploitation of continuous variables in quantum computing, in particular in the field of quantum machine learning, has been the hindrances of computing the derivatives of a model. The constraint occurs when applying the parameter-shift rule to a photonic circuit, and the number of non-Gaussian gates exceeds a logarithmic trend with respect to the length of the circuit. This condition occurs when dealing with most nonlinear functions. Indeed, it hampers subroutines, such as backpropagation, which are paramount for machine learning and, most significantly, the computation of the derivatives of the model itself. To overcome this hurdle, we propose a method to compute derivatives of functions, implemented by continuous variable circuits, directly through photonic quantum circuits. Unlike the parameter-shift rule, this method does not fail when the number of non-Gaussian gates scales more than logarithmically against the depth of the circuit. We exploit the fact that computing the derivative of a wave function is equivalent to applying the momentum operator, which in the position basis acts as its derivative. The action of this operator is physically embodied by photon-added coherent states. We prove that, up to the second order of derivation, the number of operations does not scale with the depth of the circuit, but only with the order of derivation. We showcase numerical examples of derivatives of elementary functions parametrized on simulated photonic quantum circuits. Thanks to this method, we unleash an embodiment of quantum neural networks on photonic quantum computing platforms.