Ask Your Question

kaba's profile - activity

2024-09-12 20:07:09 +0200 marked best answer Simplify logarithmic expression

I am trying to simplify the expression

1/2 * log(2) - 1/2 * log(2 * x + 2 * sqrt(x^2 - 1))

under the assumptions that x is real, and x > 1. I expect

-1/2 * acosh(x)

I tried

with assuming(x, 'real', x > 1):
    print((1/2 * log(2) - 1/2 * log(2 * x + 2 * sqrt(x^2 - 1))).full_simplify())

However, that just prints back the original expression.

I would do this by hand as follows:

 1/2 * log(2) - 1/2 * log(2 * x + 2 * sqrt(x^2 - 1))
 = 1/2 * log(2) - 1/2 * log(2 * (x + sqrt(x^2 - 1)))
 = 1/2 * log(2) - 1/2 * log(2) - 1/2 * log(x + sqrt(x^2 - 1))
 = -1/2 * log(x + sqrt(x^2 - 1))
 = -1/2 * acosh(x)

How can I get SageMath to perform this simplification?

Even without the acosh simplification I would expect to get rid of the 1/2 * log(2) term.

2024-09-12 20:07:09 +0200 received badge  Scholar (source)
2024-09-12 20:06:30 +0200 commented answer Simplify logarithmic expression

Yes, that seems to at least take care of the logarithm. Hopefully SageMath develops better simplification capability lat

2024-09-12 15:19:35 +0200 received badge  Student (source)
2024-09-12 14:19:21 +0200 edited question Simplify logarithmic expression

Simplify logaritmic expression I am trying to simplify the expression 1/2 * log(2) - 1/2 * log(2 * x + 2 * sqrt(x^2 - 1

2024-09-12 14:02:51 +0200 edited question Simplify logarithmic expression

Simplify logaritmic expression I am trying to simplify the expression 1/2 * log(2) - 1/2 * log(2 * x + 2 * sqrt(x^2 - 1

2024-09-12 14:01:48 +0200 edited question Simplify logarithmic expression

Simplify logaritmic expression I am trying to simplify the expression 1/2 * log(2) - 1/2 * log(2 * x + 2 * sqrt(x^2 - 1

2024-09-12 14:00:00 +0200 edited question Simplify logarithmic expression

Simplify logaritmic expression I am trying to simplify the expression 1/2 * log(2) - 1/2 * log(2 * x + 2 * sqrt(x^2 - 1

2024-09-12 13:58:31 +0200 edited question Simplify logarithmic expression

Simplify logaritmic expression I am trying to simplify the expression 1/2 * log(2) - 1/2 * log(2 * x + 2 * sqrt(x^2 - 1

2024-09-12 13:54:47 +0200 received badge  Editor (source)
2024-09-12 13:54:47 +0200 edited question Simplify logarithmic expression

Simplify logaritmic expression I am trying to simplify the expression 1/2 * log(2) - 1/2 * log(2 * x + 2 * sqrt(x^2 - 1

2024-09-12 13:54:04 +0200 asked a question Simplify logarithmic expression

Simplify logaritmic expression I am trying to simplify the expression 1/2 * log(2) - 1/2 * log(2 * x + 2 * sqrt(x^2 - 1

2020-08-06 13:37:54 +0200 asked a question Breaking code into multiple files on Windows

In Jupyter on Windows, I create a Notebook "testa.ipynb" as follows:

def f():
    return 3

I then create another Notebook "testb.ipynb" as follows:

import testa
testa.f()

Running this produces the error "No module named 'testa'". The files are in the same directory, which is the default "C:\Users\<user>".

How can I break my code into multiple files like this?