Mathematica中的根式通常会显示成标准的根号形式,

Mathematica进阶 - 自定义表达式显示形式

我们想让其中的根号都显示成 1/2 幂的形式, 该怎么做的?

 

Mathematica中有一套完整的计算流程, 参见帮助的 tutorial/TheMainLoop

我们通过修改其中的某一个步骤, 就可以自定义Mathematica的某些行为, 比如数据展示, 文件读取等.

以下程序即可满足我们的需求

 

a = \[Integral]Sqrt[x + Sqrt[x]] \[DifferentialD]x
$PrePrint = # //. Sqrt[p_] :> p^(HoldForm[1/2]) &;
a
$PrePrint =.;

Mathematica进阶 - 自定义表达式显示形式

相关文章:

  • 2021-05-24
  • 2021-04-03
  • 2021-09-06
  • 2022-02-06
  • 2021-09-05
  • 2021-11-22
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-05-17
  • 2022-12-23
  • 2021-06-02
  • 2022-02-05
  • 2022-12-23
相关资源
相似解决方案