hello everyone!

I have a function in R

```
A2 <- function(f) abs(1/(cos(2*pi*f*H*(1-1i*D)/Vs)))
```

I have plotted this function and found the maximum, but I only know how to find the maximum in y, I need of corresponding value in x, but I do not know how to do it.

I tried it in different ways, but i'm not a programmer, is an exercise for the university.

I built a vector in which the maxima were contained

```
N = seq(0, 100, by=0.001)
VettoreMassimo <- vector(mode = "numeric")
for(j in N)
{
VettoreMassimo[j]=abs(1/(cos(2*pi*j*H*(1-1i*D)/Vs)))
}
m = max(VettoreMassimo)
```

and if I try to use the command which.max(VettoreMassimo) i find the index of the vector.

Can anybody help me?

Sarei molto grato

(I apologize for my bad english)