Solve Reduction Problem for (1+x)^1/3 in Mathcad

  • Thread starter Thread starter PoFon
  • Start date Start date
  • Tags Tags
    Reduction
Click For Summary

Discussion Overview

The discussion revolves around the challenges of performing a reduction on the function (1+x)^1/3 in Mathcad, particularly regarding its behavior with negative input values. Participants explore the implications of raising negative numbers to fractional powers and the expected outcomes in both real and complex number contexts.

Discussion Character

  • Technical explanation
  • Debate/contested
  • Mathematical reasoning

Main Points Raised

  • One participant notes that their code works for positive numbers but fails with negative inputs, seeking a solution.
  • Another participant questions the nature of the code's failure with negative numbers and suggests that the issue may arise from Mathcad's handling of logarithms when computing powers.
  • A participant proposes a workaround involving conditional logic to handle negative inputs by computing the cube root of the negative value separately.
  • Some participants argue that raising a negative number to a fractional power typically results in a complex number, providing examples of outputs for both positive and negative inputs.
  • Another participant contends that the cube root function is defined for all real numbers and should yield a real result for negative inputs, challenging the notion that Mathcad's output is incorrect.
  • There is a discussion about the principal cube root and the existence of multiple roots for any real number, with references to external resources for clarification.
  • One participant emphasizes that while Mathcad can handle complex numbers, it may not do so effectively in the context of the reduction problem.
  • A later reply acknowledges that the proposed workaround is acceptable if only the principal root is of concern.

Areas of Agreement / Disagreement

Participants express differing views on the handling of negative numbers in the context of cube roots, with some asserting that the results should be real while others highlight the potential for complex outputs. The discussion remains unresolved regarding the best approach to implement in Mathcad.

Contextual Notes

There are limitations regarding the assumptions made about Mathcad's computational methods, particularly in relation to how it handles negative inputs and fractional powers. The discussion also reflects varying interpretations of mathematical definitions and outputs.

PoFon
Messages
2
Reaction score
0
I have a function : (1+x)^1/3 and I need to do reduction in mathcad.

I wrote this :
15s7ntz.png


But the problem is that : it does not work with negative numbers.
How to fix it?
 
Technology news on Phys.org
PoFon said:
does not work with negative numbers.
How so? What does your code do or not do?
 
Mark44 said:
How so? What does your code do or not do?

This code does reduction with positive numbers ( function (x+1)^1/3), but doesn't work with negative. And i don't know how to fix it.
 
PoFon said:
This code does reduction with positive numbers ( function (x+1)^1/3), but doesn't work with negative. And i don't know how to fix it.
Does the problem occur when your code attempts to raise a negative number to the 1/3 power? If so, algebraically there shouldn't be a problem, but MathCad is probably using logs to compute powers, in which case the expression x + 1 needs to be positive. One workaround would be to have logic that determines the sign of x + 1. If x + 1 turns out to be negative, compute (-x - 1) to the 1/3 power. That should give you a positive number, which you'll need to multiply by -1.
 
Except that raising a negative number to a fractional power generally results in a complex number. For instance, here are the results we get raising 2 and -2 to the 1/3 power (in J since I don't have MathCAD):
Code:
   2 _2 ^ %3
1.25992 0.629961j1.09112
As you can see, the result of the negative number raised to the reciprocal of 3 power is a complex number with real part 0.629961 and imaginary part 1.09112. In MathCAD, this would be represented as 0.629961 + 1.09112i .
 
DavidHume said:
Except that raising a negative number to a fractional power generally results in a complex number. For instance, here are the results we get raising 2 and -2 to the 1/3 power (in J since I don't have MathCAD):
Code:
   2 _2 ^ %3
1.25992 0.629961j1.09112
As you can see, the result of the negative number raised to the reciprocal of 3 power is a complex number with real part 0.629961 and imaginary part 1.09112. In MathCAD, this would be represented as 0.629961 + 1.09112i .
I understand what you're saying, but the problem is that the result should be a real number, not a complex number. The function ##f(x) = \sqrt[3]{x} = x^{1/3}## is defined for all real numbers, and the range is all real numbers, so taking the cube root of -2 (or raising -2 to the 1/3 power) should result in a negative real number. In my previous post I explained why many computer systems produce results that are mathematically incorrect.
 
It's not true that the range of cube root is real numbers - it's not even true for the cube root of one. Take a look at this MathCAD paper - http://gekor-it.de/media/81174be56cf4ccc5ffff870fac144233.pdf - where the author shows the cube roots of one to be (1, (-1/2)+(√3 i)/2, (-1/2)-(√3 i)/2). You can see the same result in the Wikipedia article on the root of unity: https://en.wikipedia.org/wiki/Root_of_unity .

The point for the original poster is that MathCAD can handle complex numbers but I don't know how well it does this or what it does in the context of a reduction.
 
DavidHume said:
It's not true that the range of cube root is real numbers - it's not even true for the cube root of one.
##\sqrt[3]{-1} = -1## and ##\sqrt[3]{-8} = -2##, which you can verify by raising -1 and -2 to the third power, respectively.
All of the odd roots (cube root, fifth root, seventh root, etc.) have real values for any real numbers.

DavidHume said:
Take a look at this MathCAD paper - http://gekor-it.de/media/81174be56cf4ccc5ffff870fac144233.pdf - where the author shows the cube roots of one to be (1, (-1/2)+(√3 i)/2, (-1/2)-(√3 i)/2).
Sure, there are n values for the nth root of any real number, but the principal cube root (or fifth root or seventh root, etc.) of any real number is a real number. The principal cube root of 1 is 1, just as the principal square root of 4 (denoted ##\sqrt{4}##) is 2, even though -2 is also a square root of 4. All of the odd roots have one real number principal root, so if you take the cube root of -2, you should get a real number back.
DavidHume said:
You can see the same result in the Wikipedia article on the root of unity: https://en.wikipedia.org/wiki/Root_of_unity .

The point for the original poster is that MathCAD can handle complex numbers but I don't know how well it does this or what it does in the context of a reduction.
My point is that MathCAD (or whatever) is able to find the square root of a positive number, but should also be able to take an odd root of a negative number, producing a negative real number. Due to the algorithm used, it isn't able to do so, and I gave a workaround for this inability.
 
I see - your workaround should be fine as long as you only care about the principal root.
 

Similar threads

  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
Replies
1
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 2 ·
Replies
2
Views
4K
  • · Replies 16 ·
Replies
16
Views
2K
  • · Replies 16 ·
Replies
16
Views
5K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 4 ·
Replies
4
Views
4K