I have an agent with a utility function of the form $ u(x) = -(x-g)^2 $, with $ g $ being a constant. $ x \sim Beta (a,b, \alpha, \beta) $, with $ [a,b] $ being the support, and $ \alpha, \beta $ being the parameters. I would like to calculate the expected utility of the agent. Now, I have tried to approach this in several ways, including Taylor series approximations, and would always get a different result. I am sure I am making a mistake somewhere, would you be able to point it out? Here are the 2 main approaches I have tried and I have no idea why do I get completely different results.
Approach 1
Let $ \mu $ and $ \sigma^2 $ be the mean and variance of $ x $. Then I can re-define $ x $ as $ x = \tilde{x} + \epsilon_x $, where $ E(\tilde{x}) = \mu $, $ Var(\tilde{x}) = 0 $, $E(\epsilon_x) = 0 $, and $ Var(\epsilon_x) = \sigma^2 $. Then note: $$ E[u(x)] = E[u(\tilde{x} + \epsilon_x)] = E[-(\tilde{x} + \epsilon_x-g)^2] = E[-\tilde{x}^2 + 2\tilde{x}g-2\epsilon_x \tilde{x} - g^2 +2\epsilon_x g - \epsilon^2] = -\mu^2 + 2\mu g -g^2 -\sigma^2 = -(\mu - g)^2 -\sigma^2 $$
Approach 2
Let me shorten the notation here. $ f(x) $ stands for $ f_{a,b} (α,β,x) $. $ u(b) $ stands for $ u(x) \rvert_{x=b} $ Then: $$ E[u (x)]= \int_a^b u(x) f(x) dx = u(b) - \int_a^b u'(x) F(x) dx = u(b) - u'(b) \int_a^b F(b) dx + u'(a) \int_a^b F(a) dx + \int_a^b u''(x) \int_a^b F(x) dx dx = u(b) - u'(b) \int_a^b 1 dx + u'(a) \int_a^b 0 dx + \int_a^b u''(x) \int_a^b \int_a^x f(t) dt dx dx = u(b) - u'(b) (b-a) + \int_a^b u''(x) \int_a^x (b-a) f(t) dt dx = u(b) - u'(b)(b-a) - 2(b-a) \int_a^b \int_a^x f(t) dt dx = u(b) - u'(b)(b-a) - 2(b-a)^2 F(x) = -(b-g)^2 + (b-g)(b-a) - 2(b-a)^2 F(x)$$
In approach $2$:
Using integration by parts,
$$\int_a^b u(x)f(x)dx = u(b)F(b)-u(a)F(a) - \int_a^b u'(x)F(x) dx$$
After which, I see $dxdx$ in your working.
Also, your final answer should be free from $x$.