Group Abstract Group Abstract

Message Boards Message Boards

0
|
5.2K Views
|
11 Replies
|
10 Total Likes
View groups...
Share
Share this post:

How to prove the equality of two functions?

Posted 2 years ago
Attachments:
POSTED BY: Sasha Mandra
11 Replies
Posted 2 years ago

Please take the definitions from the attached ArcCosCos file. Errors occur when copying into a text window.

POSTED BY: Sasha Mandra
Posted 2 years ago

You keep on modifiying the original post. Makes it hard to keep up a coherent discussion. However, your new version of f[x] is equal to g[x], if one applies Gianluca's suggestion of using PiecewiseExpand:

f[x_] := Which[
  0 <= Mod[x, 2 Pi] < Pi, Mod[x, Pi], 
  Pi <= Mod[x, 2 Pi] < 2 Pi,-Mod[x,Pi]+Pi
]
g[x_] := Pi (1 - (-1)^Quotient[x, Pi])/2 + (-1)^Quotient[x, Pi] Mod[x, Pi]

PiecewiseExpand[f[x] - g[x], 0 <= x < 4 Pi]
(* 0 *)

That should answer your question:

But how can this be proved with Wolfram tools?

POSTED BY: Hans Milton
Posted 2 years ago

IMHO A function in Wolfram is nothing more than its definition. Therefore, proving the equality of two functions is nothing more than establishing the equivalence of their definitions.

POSTED BY: Sasha Mandra

You can use PiecewiseExpand:

h[x_] := Which[0 <= Mod[x, 2 Pi] < Pi, Mod[x, Pi],
   Pi <= Mod[x, 2 Pi] < 2 Pi, Mod[-x, Pi]];
= 
g[x_] :  Pi (1 - (-1)^Quotient[x, Pi])/2 + (-1)^Quotient[x, Pi] Mod[x, Pi];
PiecewiseExpand[h[x] - g[x], 0 <= x < 4 Pi]
POSTED BY: Gianluca Gorni
Posted 2 years ago

As they say in my language: It was a long time ago and not true. I have long since corrected it. Check the attached file ArcCosCos, please. Copying to text causes errors.

And I remember your trick with ArcTan[1/x] + ArcTan[x]. Bravo! I've never seen that before anywhere. If there is any literature on this subject, please tell me.

POSTED BY: Sasha Mandra
POSTED BY: Michael Rogers
Posted 2 years ago

It is not a question of making sure that the functions are equal: this is already evident from the graph. I am interested in how Wolfram can get g from f and vice versa.

POSTED BY: Sasha Mandra
Posted 2 years ago

You're right! Thank you. But my question is still valid about the function f in the form of

f[x_] := Which[0 <= Mod[x, 2 \[Pi]] < \[Pi], Mod[x, \[Pi]], \[Pi] <= Mod[x, 2 \[Pi]] < 2 \[Pi], -Mod[x, \[Pi]] +  \Pi]]
POSTED BY: Sasha Mandra
Posted 2 years ago

First, let me corrected the syntax error of enclosing Pi in square brackets:

f[x_] := Which[
  0 <= Mod[x, 2 Pi] < Pi, Mod[x, Pi], 
  Pi <= Mod[x, 2 Pi] < 2 Pi, Mod[-x, Pi]
]
g[x_] := Pi (1 - (-1)^Quotient[x, Pi])/2 + (-1)^Quotient[x, Pi] Mod[x, Pi]

Then, checking equality of f[x] and g[x] over a range of values for x:

Table[f[x], {x, -10, 10, 1/10}] == Table[g[x], {x, -10, 10, 1/10}]
(* True *)
POSTED BY: Hans Milton
Posted 2 years ago

You're right! Thank you. But my question is still valid about the function f in the form of

f[x_] := Which[0 <= Mod[x, 2 \[Pi]] < \[Pi], Mod[x, \[Pi]], \[Pi] <= Mod[x, 2 \[Pi]] < 2 \[Pi], -Mod[x, \[Pi]] +  \Pi]]
POSTED BY: Sasha Mandra
Posted 2 years ago
Table[{q, f[q]==g[q]},{q, -7 Pi, 7 Pi, 2 Pi}]

returns

{{-7 Pi,False},{-5 Pi,False},{-3 Pi,False},{-Pi,False},{Pi,False},{3 Pi,False},{5 Pi,False},{7 Pi,False}
POSTED BY: Bill Nelson
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard