2

I have a function I would like to take the first and second derivative from

$$f(t)= a\left(1-\frac{1}{1+(b(t+i))^e+(c(t+i))^f+(d(t+i))^h)}\right)$$

I have taken the following steps

$$u(t)={\left(\mathrm{b}\, \left(\mathrm{i} + t\right)\right)}^{\mathrm{e}} + {\left(\mathrm{c}\, \left(\mathrm{i} + t\right)\right)}^{\mathrm{f}} + {\left(\mathrm{d}\, \left(\mathrm{i} + t\right)\right)}^{\mathrm{h}} + 1$$

$f(t) = a (1-1/u(t))$ $f(t) = a ((u(t)-1)/u(t))$

for simplicity u(t) = u and f(t)=f

f= a*(u-1)/u

quotient rule
dy = d(u-1)

df = a*((du*u-du*(u-1))/u^2)

df = a * du/u^2

quotient rule

d2f = a*((d2u*u^2-du*d(u^2))/u^4)

Is the above reasoning correct?

df= (a*(b*e*(b*(i + t))^(e - 1) + c*f*(c*(i + t))^(f - 1) + d*h*(d*(i + t))^(h - 1)))/((b*(i + t))^e + (c*(i + t))^f + (d*(i + t))^h + 1)^2

d2f=(a*((b^2*e*(e - 1)(b(i + t))^(e - 2) + c^2*f*(f - 1)(c(i + t))^(f - 2) + d^2*h*(h - 1)(d(i + t))^(h - 2))((b(i + t))^e + (c*(i + t))^f + (d*(i + t))^h + 1)^2 - (2*(b*e*(b*(i + t))^(e - 1) + c*f*(c*(i + t))^(f - 1) + d*h*(d*(i + t))^(h - 1))^2 + 2*(b^2*e*(e - 1)(b(i + t))^(e - 2) + c^2*f*(f - 1)(c(i + t))^(f - 2) + d^2*h*(h - 1)(d(i + t))^(h - 2))((b(i + t))^e + (c*(i + t))^f + (d*(i + t))^h + 1))*(b*e*(b*(i + t))^(e - 1) + c*f*(c*(i + t))^(f - 1) + d*h*(d*(i + t))^(h - 1))))/((b*(i + t))^e + (c*(i + t))^f + (d*(i + t))^h + 1)^4


$\dfrac{d}{dt} f(t) = \frac{a\, \left(b\, e\, {\left(b\, \left(i + t\right)\right)}^{e - 1} + c\, f\, {\left(c\, \left(i + t\right)\right)}^{f - 1} + d\, h\, {\left(d\, \left(i + t\right)\right)}^{h - 1}\right)}{{\left({\left(b\, \left(i + t\right)\right)}^e + {\left(c\, \left(i + t\right)\right)}^f + {\left(d\, \left(i + t\right)\right)}^h + 1\right)}^2}$

$\dfrac{d2}{d2t} f(t) =\frac{a\, \left(\left(b^2\, e\, \left(e - 1\right)\, {\left(b\, \left(i + t\right)\right)}^{e - 2} + c^2\, f\, \left(f - 1\right)\, {\left(c\, \left(i + t\right)\right)}^{f - 2} + d^2\, h\, \left(h - 1\right)\, {\left(d\, \left(i + t\right)\right)}^{h - 2}\right)\, {\left({\left(b\, \left(i + t\right)\right)}^e + {\left(c\, \left(i + t\right)\right)}^f + {\left(d\, \left(i + t\right)\right)}^h + 1\right)}^2 - \left(2\, {\left(b\, e\, {\left(b\, \left(i + t\right)\right)}^{e - 1} + c\, f\, {\left(c\, \left(i + t\right)\right)}^{f - 1} + d\, h\, {\left(d\, \left(i + t\right)\right)}^{h - 1}\right)}^2 + 2\, \left(b^2\, e\, \left(e - 1\right)\, {\left(b\, \left(i + t\right)\right)}^{e - 2} + c^2\, f\, \left(f - 1\right)\, {\left(c\, \left(i + t\right)\right)}^{f - 2} + d^2\, h\, \left(h - 1\right)\, {\left(d\, \left(i + t\right)\right)}^{h - 2}\right)\, \left({\left(b\, \left(i + t\right)\right)}^e + {\left(c\, \left(i + t\right)\right)}^f + {\left(d\, \left(i + t\right)\right)}^h + 1\right)\right)\, \left(b\, e\, {\left(b\, \left(i + t\right)\right)}^{e - 1} + c\, f\, {\left(c\, \left(i + t\right)\right)}^{f - 1} + d\, h\, {\left(d\, \left(i + t\right)\right)}^{h - 1}\right)\right)}{{\left({\left(b\, \left(i + t\right)\right)}^e + {\left(c\, \left(i + t\right)\right)}^f + {\left(d\, \left(i + t\right)\right)}^h + 1\right)}^4}$

  • This is very difficult to read. Are the m's constants and the this is a function of $t$ only? – Amzoti Jun 23 '13 at 01:46
  • yes the m's are all constant and the function is only dependent on t. The m's differ for every individual. – Niels De Blende Jun 23 '13 at 02:04
  • This is not very difficult to read, it is impossible! Please, try to find some $\TeX$ editor to do the work for you. I don't think anyone is brave enough to "reverse code" this. – Pedro Jun 23 '13 at 02:12
  • @NielsDeBlende: Please check that I wrote $f(t)$ properly in my response. – Amzoti Jun 23 '13 at 02:27
  • sorry for all the horrible code. I've tried to convert it into latex by using the latexs command in matlab. However if i paste it here it doesn't really give what I want. If anyone can tell me what I've done wrong that would be great. Thanks (the latex? code is below) – Niels De Blende Jun 23 '13 at 02:42
  • @NielsDeBlende would you look at the first equation and see if my correction is what you intended? You seemed to have forgotten some parenthesis so it made it a little hard to parse. – Cameron Williams Jun 23 '13 at 02:52
  • the first equation is indeed correct, thanks – Niels De Blende Jun 23 '13 at 03:56

1 Answers1

1

Let $m1 = a, m2 = b, m3 = c, m4 = d , m5 = e, m6 = f, m7 = h, m8 = i$.

$\dfrac{d}{dt} f(t) = \dfrac{d}{dt}\left[(a (1-1/(1+(b (t+i))^e+(c (t+i))^f+(d (t+i))^h)))\right] = \dfrac{(a (e (b (i+t))^e+f (c (i+t))^f+h (d (i+t))^h))}{((i+t) ((b (i+t))^e+(c (i+t))^f+(d (i+t))^h+1)^2)}$

$\dfrac{d^2}{dt^2} f(t) = \dfrac{d^2}{dt^2} \left[(a (1-1/(1+(b (t+i))^e+(c (t+i))^f+(d (t+i))^h)))\right] = a\left[\dfrac{ ((b^2 (e-1) e (b (i+t))^{e-2}+c^2 (f-1) f (c (i+t))^{f-2}+d^2 (h-1) h (d (i+t))^{h-2})}{\left((b (i+t))^e+(c (i+t))^f+(d (i+t))^h+1\right)^2-\dfrac{2 (b e (b (i+t))^{e-1}+c f (c (i+t))^{f-1}+d h (d (i+t))^{h-1})^2}{\left((b (i+t))^e+(c (i+t))^f+(d (i+t))^h+1\right)^3}}\right]$

Update

If we write, $f(t) = a\left(1 - \dfrac{1}{u(t)}\right)$, then, by the quotient rule, we have:

$$f'(t) = a\left(0 - \dfrac{0 - u'(t) \cdot 1}{u^2(t)}\right) = a\dfrac{u'(t)}{u^2(t)}$$

Amzoti
  • 56,093
  • I saw this earlier...good to have posted a great answer (what a monster to format, with all the parentheses and bracktets, not to mention the fraction.
  • – amWhy Jun 23 '13 at 02:38
  • 10000 times thanks. I couldn't do it. Does my reasoning to get to this formula stands? – Niels De Blende Jun 23 '13 at 02:46
  • @NielsDeBlende: I think you should use the approach I showed (making all those variable names easier and then find the first derivative and validate what I got. Currently, your approach is not looking correct to me, but it may be algebra related and I cannot read it. If you have issues doing my approach, please report back. Regards – Amzoti Jun 23 '13 at 02:50
  • It's a growth function. I'm a biology student (that's why the ugly math and the unawareness of latex). Atm I'm trying to convert the formula into latex context – Niels De Blende Jun 23 '13 at 03:02
  • @NielsDeBlende: Are you trying to use my approach? At the end, you can substitute back all the original variable names you had as they make things very messy with derivatives. Regards – Amzoti Jun 23 '13 at 03:20
  • I've tried to use your approach. It's very helpfull. d2f is not how it should be but it is in latex formation. – Niels De Blende Jun 23 '13 at 03:55
  • thanks a lot. If i compare both df's in your and mine df equation it seems to look the same. – Niels De Blende Jun 23 '13 at 04:40
  • @NielsDeBlende: Excellent! Now, work on the second part (which is the same approach, but a lot more ugly algebra). Good luck! Regards – Amzoti Jun 23 '13 at 04:45