Questions tagged [derivative]

In calculus, a derivative is a measure of a function's rate of change as its input changes.

Loosely speaking, a derivative can be thought of as how much one quantity is changing in response to changes in some other quantity; for example, the derivative of the position of a moving object with respect to time is the object's instantaneous velocity.

The derivative of a function at a chosen input value describes the best linear approximation of the function near that input value. For a real-valued function of a single real variable, the derivative at a point equals the slope of the tangent line to the graph of the function at that point. In higher dimensions, the derivative of a function at a point is a linear transformation called the linearization.1 A closely related notion is the differential of a function.

The process of finding a derivative is called differentiation. The reverse process is called antidifferentiation. The fundamental theorem of calculus states that antidifferentiation is the same as integration. Differentiation and integration constitute the two fundamental operations in single-variable calculus.

enter image description here

845 questions
4
votes
2 answers

Finding the maximum gradient of a growth curve

I have made a graph with four growth curves using ggplot2. Hopefully the code below should produce the graph if anyone wants to try. I want to find a value for the maximum slopes on each of the lines, taken over say 4 time points. Can anyone give…
dx99
  • 53
  • 1
  • 5
4
votes
4 answers

Calculate the derivative of a data-function in r

Is there an easy way to calculate the derivative of non-liner functions that are give by data? for example: x = 1 / c(1000:1) y = x^-1.5 ycs = cumsum(y) plot (x, ycs, log="xy") How can I calculate the derivative function from the function given…
R_User
  • 10,682
  • 25
  • 79
  • 120
3
votes
2 answers

Symbolic functions in matlab

I'm sorry if I'm not formerly correct; I would like to work with symbolic functions, like i.e. x(t) without the need to actually define x. This may be useful because sometimes you'll have functions of x, and you want to calculate the derivative in…
Manlio
  • 10,768
  • 9
  • 50
  • 79
3
votes
2 answers

curve fitting with a date object

My goal is to calculate the slope of a curve. I read that I can take the first derivation for this. Which in turn requires a formula that describes my data. So I am looking into curve fits rigth now, but can not find anything that describes how to…
uke
  • 462
  • 1
  • 11
3
votes
1 answer

Why the Derivative of a function computed using scipy is varying with the value of parameter dx?

I tried computing the value of the derivative of a function using both sympy and scipy. The value computed using scipy is varying with changing the value of the parameter 'dx' for the derivative function is scipy. The code is given below import…
Igris
  • 143
  • 1
  • 7
3
votes
1 answer

Julia Symbolics can't simplify derivative expressions

I am using the Symbolics package in Julia, and it seems to not be simplifying derivatives of expressions. E.g.: @variables r Dr = Differential(r) simplify(expand_derivatives(Dr((2/r)^2))) results in (-4(2 / (r^2))) / r If I instead create the…
3
votes
1 answer

Derivative of BatchNorm2d in PyTorch

In my network, I want to calculate the forward pass and backward pass of my network both in the forward pass. For this, I have to manually define all the backward pass methods of the forward pass layers. For the activation functions, that's easy.…
sebko_iic
  • 340
  • 2
  • 16
3
votes
1 answer

Plotting derivative of nls model in R

I have used nls function to fit the following equation y ~ (C + (A1*exp(-x/h1)) + (A2*exp(-x/h2))) My code looks as follows f <- as.formula(y ~ (C + (A1*exp(-x/h1)) + (A2*exp(-x/h2)))) nls_b <- nls(f, data = df, start = list(C = 0.140, A1 = 0.051,…
UseR10085
  • 7,120
  • 3
  • 24
  • 54
3
votes
2 answers

Issue on renaming functions

I'm writing some code to calculate derivatives of functions. I managed to generate 1st and 2nd derivatives for 1 variable and store in the environment as functions, so I can plot them later. Now I'm trying to calculate the partial derivates for…
y154707
  • 93
  • 5
3
votes
1 answer

How can I estimate the first derivative of an evaluated univariate function in C++?

I have a two vectors: Coordinates along an axis, x; An evaluation of a function on those coordinates, f(x). and I want to compute an estimate of the first derivative of f at these coordinates. The function is a descriptor of a wavefunction and x…
Jonny_92
  • 42
  • 9
3
votes
0 answers

Tensorflow/Keras - Use NN derivative in loss function

I'm currently estimating the sine function using tensorflow. I'd like to include the fact that the second derivative of sinus is equal to -sinus by adding a derivative term in my loss function. I'm fairly new to tf. My current code looks like…
s1624210
  • 627
  • 4
  • 11
3
votes
1 answer

Sympy returns log instead of ln

I have this equation: import sympy as sp x = sp.Symbol(‘x’, real = True) fx = sp.log(x,3) sp.diff(fx, x) Sympy returns: 1/(x*log(3)) Sympy should return: 1/(x*ln(3)) Why is Sympy returning the log function rather than the natural log function?
vic
  • 35
  • 1
  • 1
  • 6
3
votes
3 answers

Finding a derivative of a polynomial in Python

I have a problem with this task. I have to print a polynomial, which is an input from a user. (I have problem with this too because it can be polynomial of any degree and I'm not so sure how to print it). The second part of the task is to find a…
3
votes
1 answer

Why do TensorFlow and PyTorch gradients of the eigenvalue decomposition differ from each other and the analytic solution?

The following code computes the eigenvalue decomposition of a real symmetric matrix. Then, the gradient of the first eigenvalue with respect to the matrix is computed. This is done three times: 1) using the analytic formula, 2) using TensorFlow, 3)…
3
votes
1 answer

Python - Find min, max, and inflection points of normal curve

I am trying to find the locations (i.e., the x-value) of minimum, start of season, peak growing season, maximum growth, senescence, end of season, minimum (i.e., inflection points) in a vegetation curve. I am using a normal curve here as an example.…
pyPN
  • 105
  • 3
  • 9