The formula for the electric field at a point due to a charge $Q$ (just considering the magnitude) at some distance $x$ away from the point is $E=\dfrac{k_eQ}{x^2}$ where $k_e$ is a constant equal to approximately $8.99 \times 10^{9}$.
If we now consider a uniformly charged rod with charge density $\lambda$ and length $L$, then the charge of the entire rod is $\lambda L$.
Assuming a point $P$ that is $a$ units from the end of the rod along the $x$-axis, how would I express the derivative of the electric field with respect to $x$ when the charge $Q$ is a function of $x$, but the electric field $E$ varies with both $Q$ and the inverse square of the distance between $x$ and the point $P$? Isn't $E$ a function of two variables in this case?