# Solving an integral equation for upper boundary

Mathematica Asked by leosenko on December 18, 2020

I am reading a paper on High Harmonics Generation (HHG) and a Lewenstein model The paper is here. I would like to reproduce some results but I am stuck at the following problem. I have:
$$p(tau_b,tau)=frac{e}{tau-tau_b}int_{tau_b}^tau {rm d}tau^{‘} A(tau^{‘}),,$$
where $A(tau)$ is vector potential (given).

The time of birth $t_b$ as a function of $tau$ is determined by solution of the algebraic equation:
$$p(tau_b,tau)-e , A(tau_b)=0$$

How should I approach solving such an equation. I was thinking:

A[t_] := -Sin[t];
τ = 0.5;
FindRoot[NIntegrate[A[t], {t, τb, τ}]/(τ - τb) -
A[τb] == 0, {τb, 1}]


But Mathematica keeps saying

t = τb is not a valid limit of integration


Maybe there is an error in my solution. But besides making it work with Mathematica specific approach, what would a more general numerical approach be for such a solution?

Thank you.

"FindRoot first localizes the values of all variables, then evaluates f with the variables being symbolic, and then repeatedly evaluates the result numerically" is written in the documentation in the Details and Options section.

The reason

A[t_] := -Sin[t]
τ = 0.5;
FindRoot[NIntegrate[A[t], {t, τb, τ}]/(τ - τb) - A[τb] == 0, {τb, 1}]


doesn't work is because it attempts to evaluate

NIntegrate[A[t], {t, τb, τ}]


symbolically which fails.

Using belisarius's solution

k[s_?NumericQ] := NIntegrate[A[t], {t, s, τ}]
FindRoot[k[τb]/(τ - τb) - A[τb] == 0, {τb, 1}]


works because k[τb] can be evaluated symbolically simply giving back k[τb].

When numerical evaluation is applied the function definition is used enabling

NIntegrate[A[t], {t, s, τ}]


to be evaluated.

Answered by Jack LaVigne on December 18, 2020

As noted by Jack LaVigue, FindRoot by default tries first to evaluate its first argument symbolically, which fails here. However, it is possible to instruct FindRoot not to do so by employing the option Evaluated -> False.

A[t_] := -Sin[t];
τ = 0.5;
FindRoot[NIntegrate[A[t], {t, τb, τ}]/(τ - τb) - A[τb] == 0, {τb, 1}, Evaluated -> False]


FindRoot returns without error the not particularly interesting but correct answer {τb -> 0.5}. With an initial guess of 2, it instead returns {τb -> 2.0984}

Answered by bbgodfrey on December 18, 2020

## Related Questions

### Parallelizing large sum to use all cpu cores

1  Asked on March 12, 2021

### How can I eliminate artificial oscillation created by numerical solution (NDSolve)?

0  Asked on March 12, 2021 by crises

### Plotting a graph of a square root function does not show the expected graph

1  Asked on March 11, 2021 by jesper-johansson

### What is wrong in my calculation with Clebsch-Gordan coefficients?

2  Asked on March 11, 2021

### Graph styling using HighlightGraph, GraphHighlightStyle and VertexStyleat the same time

0  Asked on March 11, 2021

### How I found the value

1  Asked on March 11, 2021 by slayz

### Mathematica Can Find the Primitive Function But It Cannot Find the Closed Form for Corresponding Definite Integral

1  Asked on March 11, 2021 by hosein-rahnama

### How to make i not euqal to j in a Double Sum

2  Asked on March 10, 2021 by hao-wang

### How can I make such drawings

1  Asked on March 10, 2021 by ragab-zidan

### Strange behaviour in ToElementMesh

1  Asked on March 10, 2021

### Give NeumannValue a nonlinear function

1  Asked on March 10, 2021

### Construct a permutation tree plot

4  Asked on March 9, 2021 by matrix89

### How to get function to ‘expand’ while inactivating inner functions

1  Asked on March 9, 2021

### Unexpected display of Dataset object

1  Asked on March 9, 2021

### Parameterized derivative when chain rule usually in order

2  Asked on March 9, 2021 by abcderia

### Multiple nested (time ordered) integrals with NIntegrate

0  Asked on March 9, 2021 by marsupilami

### MeshRegion automatically merges vertices that have the same position in space

0  Asked on March 9, 2021 by yousuf-soliman

### Solving partial differential equation

0  Asked on March 9, 2021 by nazanin-variji

### Upper incomplete Gamma function numerical differences

2  Asked on March 9, 2021 by kospall

### Finding diagonal $p$ of a cyclic quadrilateral with sides $(a,b,c,d)$

1  Asked on March 9, 2021

### Ask a Question

Get help from others!