# How can I use Zygote to get the gradient

Hello,

I am new here and i just add the pkg Zygote to find the gradient of the function (2+2*alpha-3)^2, i want to get the value of alpha how can i do that

What do you mean by “getting the value of alpha”?

In automatic differentiation, when differentiating a function you get a function that you can evaluate on a specific value. For example:

julia> using Zygote
julia> f(α) = (2 + 2α - 3)^2
julia> f'(1)
4 # equivalent to 2 * (2 + 2 * 1 - 3) * 2 = 4


I suppose the only way to make sense of it is you want the df/d\alpha at a particular value of alpha.