# Using an InterpolatingFunction in another function?

**URL:** <https://community.wolfram.com/t/using-an-interpolatingfunction-in-another-function/7153>\
**Category:** Questions\
**Tags:** engineering\
**Created:** [November 9, 2015, 8:12am UTC](https://community.wolfram.com/t/using-an-interpolatingfunction-in-another-function/7153 "2015-11-09T08:12:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![naperry21](https://avatars.discourse-cdn.com/v4/letter/n/b5ac83/32.png) [@naperry21](https://community.wolfram.com/u/naperry21)\
**Post date:** [November 9, 2015, 8:12am UTC](https://community.wolfram.com/t/using-an-interpolatingfunction-in-another-function/7153/1 "2015-11-09T08:12:31Z")

</div>

I used NDsolve for a first order ODE which results in an Interpolating Function for y[x]. My question is how do I use the values of this function y[x] in some other function f(y[x])? I do not really care what the values are for f(y[x]), but rather just need to plot this function.  
Solution found. Use First[Evaluate [interpolating function] when including it in another function.

ifun = NDSolve[ODE, y[0] == 0.1}, y, {x, 0, 5}, Method → “ExplicitRungeKutta”]

Plot[Evaluate[y[x] /. ifun], {x, 0, 5}, AxesLabel → {“X”, “Y[X]”}]

Other Function with ifun = (200x)/y[x]

Plot[Other Function with ifun, {x, 0, 5}]

---

<div class="post-metadata">

**Author:** ![lehinp](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/lehinp/32/8056_2.png) [@lehinp](https://community.wolfram.com/u/lehinp)\
**Post date:** [November 11, 2015, 11:22am UTC](https://community.wolfram.com/t/using-an-interpolatingfunction-in-another-function/7153/2 "2015-11-11T11:22:44Z")

</div>

Hi Nick,

The solution is quite obvious:

```
ifun = NDSolve[{y'[x] == y[x] Cos[x + y[x]], y[0] == 1}, y, {x, 0, 30}];

Plot[Evaluate[(200 x)/y[x] /. ifun], {x, 0, 5}, AxesLabel -> {"X", "\!\(\*FractionBox[\(200\\\ X\), \(Y[X]\)]\)"}]

```

> 

 ![6482i.png](https://global.discourse-cdn.com/wolfram/original/3X/7/d/7d00608cfb02f4c19442939623f793b85493fb3f.png)
