lagranges interpolation method (c/c++ program)?
951729
See this site for details of lagrange polynomials, then the program shouldn't be hard to write:\n\nhttp://en.wikipedia.org/wiki/Lagrange_interpolation
344651
Hey, email me, LBphan@gmail.com, i might be able to help you out a bit, ive got some stuff for c++ and c# if youre curious, and ill give you whatever youre looking for free of charge.  my name is andy, by the way.
684813
I had to refresh myself on the method of Lagrange multipliers. The following theorem is paraphrased from a problem in Spivak's "Calculus on Manifolds", an excellent calculus text for mathematicians.\nLet A be a subset of R^n. If g:A -> R^m is differentiable and has rank m on the kernel of g, and if f:R^n -> R is also differentiable and the extremum of f on the kernel of g occurs at a, then there exist m real multipliers L1, ..., Lm such that df(a) = (L1)d(g1)(a) + ... + (Lm)d(gm)(a). (d is the differential operator)\nThe proof is not that difficult, but a concise one would require the introduction of too much machinery, so we'll leave it as something to look up.\nIf g has only one component function (if g:A -> R), then the above is very simple with only one multiplier. If n=2, the kernel of g is just a curve in R^2 and the graph of f is a surface in R^3. In this case, you can visualize the constraint on the surface as a curve in the surface of f whose projection on R^2 considered as a subset of R^3 is the kernel of g.\nIn your case, we want to minimize the distance function f(x, y, z) = Sqrt[x^2 + y^2 + z^2] over the two surfaces above, or equivalently the kernel of the differentiable function g(x, y, z) = (2y + 4z - 5, 4(x^2 + y^2) - z^2) (g is thus a map from R^3 -> R^2, so m = 2. The kernel of g is trivially the intersection of the two surfaces. You should show that the rank of g is 2 whenever g(x, y, z) = 0 to validate the use of Lagrange multipliers). \nWe simplify this by noting that the points corresponding to the minimum of f over the kernel of g coincides with the points corresponding to the minimum of [f(x, y, z)]^2 = F(x, y, z) over the kernel of g which is easier to deal with. The theorem tells us we will have to deal with two Lagrange multipliers, one for each component of g. We thus have the system of 5 equations:\n2x = (L1)*0 + (L2)*8x\n2y = (L1)*2 + (L2)*8y\n2z = (L1)*4 + (L2)*(-2z)\ng(x, y, z) = (2y + 4z - 5, 4(x^2 + y^2) - z^2) = (0, 0)\nThese are 5 equations in 5 unknowns, so it is easily solved. Note that the actual values of the multipliers are seldom important.\n\nIn case you are not familiar with the differential operator, if f(x, y, z) = x^2 + y^2 + z^2 + xy, then df(x, y, z) is a covector (actually a cotangent bundle in more formal terms) such that df(x, y, z) = 2x dx + 2y dy + 2z dz. It is similar to notation for implicit differentiation but has a much more rigorous foundation and is used in differential geometry. The dx, dy and dz terms are treated as basis vectors, thus the above is a 3-dimensional vector, normally called the gradient of f in multivariable calculus, where it is treated as if it were a vector in R^3: (2x, 2y, 2z). You should now see where the first 3 equations come from.
547629
assuming u is an unknown variable y=0
1099598
If you mean an exponent, the function in C is pow(x,y)
594655
http://email.about.com/cs/oetipstricks/qt/et051102.htm
1140302
Here is an interactive page that discusses one way to do it:\n\nhttp://dilc.upd.edu.ph/loDeploy/math/math10a.html\n\nFor large numbers, bequalmings technique using logs is an easier way to go.
168156
get a TI 82 or above graphing calculator.  MUCH easier. program already installed, just build the type of matrix,, and plug in the numbers
983919
Here you go\nhttp://www.thefreecountry.com/compilers/cpp.shtml\n///
346423
check out http://www.planet-source-code.com - I don't do C++, but I use that site all the time, and it has great examples in source code form.
163135
CHOOSE one of the follwing depending upon your course curriculum\n\n\n//Use to following program for multiple calculations in one \n//run.\n\nvoid main()\n{\n\nint a,b; // Declare variables "a" and "b" to get two\n// numbers.\n\n  char Continue = 'Y'; // Declare Continue to loop through \n//the program for multiple calculations. and initialize it \n//to 'Y'\n\n  while(Continue == 'Y' || Continue == 'y') \n// Continue doing the folliwing if the user presses 'Y' for\n// continue.\n  {\n\n  printf("Enter First Number: ");\n  scanf("%d",&a); //scan or get first number\n\n  printf("&#92;nEnter Second Number: ");\n  scanf("%d",&b); //scan or get second number\n\n  printf("&#92;n %d %d  &#92;"DIVISION&#92;" = %f",a,b,(float)a/b); \n// Divide and display the result\n\n  printf("&#92;n %d MOD %d  &#92;"MODULUS&#92;" = %d",a,b,a%b); \n// Calculate Modulus.\n\n  printf("&#92;n&#92;n Do you want to Continue? (Y/N)  :"); \n// Prompt if youser wants to continue.\n  scanf("%s",&Continue);\n\n  printf("&#92;n &#92;n --------------------------------- &#92;n &#92;n"); \n// print saperator between multiple calculations.\n  }\n}\n\n-------------------------------------------------------------------------------------------------------\n\n// Use Following for single calculation in one run...\nvoid main()\n{\n  int a,b; // Declare variables "a" and "b" to get two\n// numbers.\n \n  printf("Enter First Number: ");\n  scanf("%d",&a); //scan or get first number\n  \n  printf("&#92;nEnter Second Number: ");\n  scanf("%d",&b); //scan or get second number\n  \n  printf("&#92;n %d %d  &#92;"DIVISION&#92;" = %f",a,b,(float)a/b); // \n  // Divide and display the result\n  \n  printf("&#92;n %d MOD %d  &#92;"MODULUS&#92;" = %d",a,b,a%b); \n  // Calculate Modulus and print.\n\n}\n\n\nNote: You can not use floats in modulus.
190850
also try  http://mathworld.wolfram.com/ImplicitDifferentiation.html
88038
It's been too long, so I'm very rusty on this but you could look at Lp norm  ||f|| = pth Root of (integral( f^p)) where the integral is taken over the real line. Try L2.
532934
INT[(1 - x)/x dx]\nINT[x^-1 (1-x) dx]\nINT[x^-1 - 1 dx]\nln|x| - x + C
791713
Instead of \n-size ${iSize}c\ntry   \n-size +${iSize}c
397803
/*\n\ni need to know an example of writting a program in c\nlanguage under linux using threads?\n\nwrite aprogram to calculate the result of the equation\nY=3sin(x)+6cos(x)+5x2 so each term accomplished by a\nthread. The main thread will calculate the result.\n\n*/\n\n\n#include <pthread.h>\n#include <math.h>\n#include <stdlib.h>\n#include <stdio.h>\n\n/* static global location -- all threads will read */\nstatic double x;\n\nstatic void*\nthree_sinx(void*p)\n{\n  double* result = (double*)p;\n  *result = 3 * sin(x);\n  return 0;\n}\n\nstatic void*\nsix_cosx(void*p)\n{\n  double* result = (double*)p;\n  *result = 6 * cos(x);\n  return 0;\n}\n\nstatic void*\nfive_x_squared(void*p)\n{\n  double* result = (double*)p;\n  *result = 5 * x * x;\n  return 0;\n}\n\n/*\n *\n * Y = 3sin(x) + 6cos(x) + 5x2\n *\n */\n\nint\nmain(int argc, char* argv[])\n{\n  double result[3]; /* one location for each thread */\n  pthread_t tid[3];\n  void *r;\n  int i;\n\n  /* Set "x" to double value passed in on command line */\n  x = argc>1 ? strtod(argv[1], 0) : 0;\n\n\n  /*\n   *  Since result areas are distinct, no mutex needed\n   */\n  if (pthread_create(&tid[0], NULL,\n    three_sinx, &result[0]) != 0) {\n    perror("pthread_create[0]"), exit(-1);\n  }\n\n  if (pthread_create(&tid[1], NULL,\n    six_cosx, &result[1]) != 0) {\n    perror("pthread_create[1]"), exit(-1);\n  }\n\n  if (pthread_create(&tid[2], NULL,\n    five_x_squared, &result[2]) != 0) {\n    perror("pthread_create[2]"), exit(-1);\n  }\n\n  /* Synchronize on the completing child threads */\n  for (i=0; i<3; i++) {\n    if (pthread_join(tid[i], &r) != 0) {\n      perror("pthread_join");\n      exit(-1);\n    }\n  }\n\n  /* main thread will now combine the result */\n  printf("For y=3sin(x)+6cos(x)+5x2, when x=%f, y=%f&#92;n",\n      x, result[0]+result[1]+result[2]);\n\n  return 0;\n}\n\n\n\nTo show that it works:\n\n$ cc pthr.c -lpthread -lm\n\n$ a.out 3.14159\nFor y=3sin(x)+6cos(x)+5x2, when x=3.141590, y=43.347947\n\n$ a.out 0\nFor y=3sin(x)+6cos(x)+5x2, when x=0.000000, y=6.000000
964471
Hi there you can go to www.cplusplus.com\nOr if you want help ina specific topic just goolgle iT. fOR example\narrays in C++ go to i'm feeling lucky