concept partial derivative in category python

This is an excerpt from Manning's book Math for Programmers: 3D graphics, machine learning, and simulations with Python.
Notice that in both the slope approximation and the symbolic derivative process, the variable y doesn’t appear. Instead, we’re working with the constant value 2. This is to be expected because when we’re thinking about a partial derivative in the x direction, y isn’t changing. The general way to calculate partial derivatives symbolically is to take the derivative as if only one symbol (like x) is a variable, while all the other symbols (like y) are constants.
Using this method, the partial derivative of U(x, y) with respect to x is ½(2x + 0) = x, and the partial derivative with respect to y is ½(0 + 2y) = y. By the way, the notation f’(x) we previously preferred for the derivative of a function f(x) is insufficient to extend to partial derivatives. When taking partial derivatives, you can take the derivative with respect to different variables, and you need to specify which one you’re working with. There’s another equivalent notation for the derivative of f’(x):
![]()
(I use the ≡ sign to indicate that these notations are equivalent; they represent the same concept.) This is reminiscent of the slope formula Δf/Δx, but in this notation, df and dx instead represent infinitesimal changes in the value of f and x. The notation df/dx means the same thing as f’(x), but it makes it clearer that the derivative is taken with respect to x. For a partial derivative of a function like U(x, y), we can take the derivative with respect to either x or y. It’s traditional to use different shaped d’s to indicate that we’re not taking an ordinary derivative (called a total derivative). The partial derivatives of U with respect to x and y are (respectively) written as follows:
The partial derivatives of a scalar field give the rate of change in the value of the field with respect to the coordinates. For instance, if U(x, y) is a scalar field in 2D, there are partial derivatives with respect to x and y. Partial derivatives are the same as the derivatives of a cross section of the scalar field. You can calculate the partial derivative with respect to one variable by treating the other variables as constants.