1
$\begingroup$

I'm new to Mathematica and I keep getting this error(in the title) when I'm trying to solve this definite integral numerically. This is for a math class where we have to use the arc length.

f[x_] := 6 x[1 - x]
NIntegrate[Sqrt[1. + f'[x]^2], {x, 0., 1.}]

Any help would be appreciated. I've googled several times and while a lot of people are getting the same error, their solutions/problems aren't really the same as mine. My instructor showed us this exact syntax I am pretty sure and he was getting the correct answer.

The error is

NIntegrate::inumr: The integrand Sqrt[1. +36 (1[1+Times[<<2>>]]-(x^[Prime])[Plus[<<2>>]])^2] has evaluated to non-numerical values for all sampling points in the region with boundaries {{0.,1.}}.

EDIT: Thank you. I thought it was brackets for some reason.

$\endgroup$

closed as off-topic by Michael E2, ilian, m_goldberg, Bob Hanlon, xzczd Oct 17 '16 at 5:49

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question arises due to a simple mistake such as a trivial syntax error, incorrect capitalization, spelling mistake, or other typographical error and is unlikely to help any future visitors, or else it is easily found in the documentation." – Michael E2, ilian, m_goldberg, Bob Hanlon, xzczd
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    $\begingroup$ Try f[x_] := 6 x(1 - x): Parentheses for grouping, square brackets for function calls. $\endgroup$ – Michael E2 Oct 16 '16 at 22:44
  • $\begingroup$ Zach, if you forget your password, see mathematica.stackexchange.com/users/account-recovery. If not, then there some other person trying to edit your post and pretend to be you. $\endgroup$ – Michael E2 Oct 16 '16 at 23:00
0
$\begingroup$
f[x_] := 6 x[1 - x]

This is a mistake!

The right definition of a function is:

f[x_]:=6x(1-x)

Please remember: [] is a function flag. () is grouping the terms of a expression.

$\endgroup$
  • $\begingroup$ Pretty much what I said in my comment! $\endgroup$ – Michael E2 Oct 17 '16 at 2:08

Not the answer you're looking for? Browse other questions tagged or ask your own question.